@univerjs/docs-quick-insert-ui 0.7.0 → 0.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +275 -264
- package/lib/index.css +1 -1
- package/lib/index.js +275 -264
- package/lib/types/locale/en-US.d.ts +32 -2
- package/lib/types/locale/fa-IR.d.ts +2 -2
- package/lib/types/locale/ru-RU.d.ts +2 -2
- package/lib/types/locale/vi-VN.d.ts +2 -2
- package/lib/types/locale/zh-CN.d.ts +2 -32
- package/lib/types/locale/zh-TW.d.ts +2 -2
- package/lib/umd/index.js +1 -1
- package/package.json +14 -14
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
declare const locale: {
|
|
17
|
+
docQuickInsert: {
|
|
18
|
+
menu: {
|
|
19
|
+
numberedList: string;
|
|
20
|
+
bulletedList: string;
|
|
21
|
+
divider: string;
|
|
22
|
+
text: string;
|
|
23
|
+
table: string;
|
|
24
|
+
image: string;
|
|
25
|
+
};
|
|
26
|
+
group: {
|
|
27
|
+
basics: string;
|
|
28
|
+
};
|
|
29
|
+
placeholder: string;
|
|
30
|
+
keywordInputPlaceholder: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
3
33
|
export default locale;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
declare const locale: typeof
|
|
1
|
+
import { default as enUS } from './en-US';
|
|
2
|
+
declare const locale: typeof enUS;
|
|
3
3
|
export default locale;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
declare const locale: typeof
|
|
1
|
+
import { default as enUS } from './en-US';
|
|
2
|
+
declare const locale: typeof enUS;
|
|
3
3
|
export default locale;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
declare const locale: typeof
|
|
1
|
+
import { default as enUS } from './en-US';
|
|
2
|
+
declare const locale: typeof enUS;
|
|
3
3
|
export default locale;
|
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
declare const locale: {
|
|
17
|
-
docQuickInsert: {
|
|
18
|
-
menu: {
|
|
19
|
-
numberedList: string;
|
|
20
|
-
bulletedList: string;
|
|
21
|
-
divider: string;
|
|
22
|
-
text: string;
|
|
23
|
-
table: string;
|
|
24
|
-
image: string;
|
|
25
|
-
};
|
|
26
|
-
group: {
|
|
27
|
-
basics: string;
|
|
28
|
-
};
|
|
29
|
-
placeholder: string;
|
|
30
|
-
keywordInputPlaceholder: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
1
|
+
import { default as enUS } from './en-US';
|
|
2
|
+
declare const locale: typeof enUS;
|
|
33
3
|
export default locale;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
declare const locale: typeof
|
|
1
|
+
import { default as enUS } from './en-US';
|
|
2
|
+
declare const locale: typeof enUS;
|
|
3
3
|
export default locale;
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/docs-drawing"),require("@univerjs/docs-drawing-ui"),require("@univerjs/drawing"),require("@univerjs/drawing-ui"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("@univerjs/docs-ui"),require("rxjs"),require("@univerjs/docs"),require("react/jsx-runtime"),require("@univerjs/design"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs-drawing","@univerjs/docs-drawing-ui","@univerjs/drawing","@univerjs/drawing-ui","@univerjs/engine-render","@univerjs/ui","@univerjs/docs-ui","rxjs","@univerjs/docs","react/jsx-runtime","@univerjs/design","react"],s):(c=typeof globalThis<"u"?globalThis:c||self,s(c.UniverDocsQuickInsertUi={},c.UniverCore,c.UniverDocsDrawing,c.UniverDocsDrawingUi,c.UniverDrawing,c.UniverDrawingUi,c.UniverEngineRender,c.UniverUi,c.UniverDocsUi,c.rxjs,c.UniverDocs,c.React,c.UniverDesign,c.React))})(this,function(c,s,R,te,Se,_e,z,p,S,C,E,m,k,f){"use strict";var We=Object.defineProperty;var Ve=(c,s,R)=>s in c?We(c,s,{enumerable:!0,configurable:!0,writable:!0,value:R}):c[s]=R;var P=(c,s,R)=>Ve(c,typeof s!="symbol"?s+"":s,R);const ne={id:"doc.command.delete-search-key",type:s.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(s.ICommandService),{start:t,end:r}=n;return e.syncExecuteCommand(S.CutContentCommand.id,{segmentId:"",textRanges:[{startOffset:t,endOffset:t,collapsed:!0}],selections:[{startOffset:t,endOffset:r,collapsed:!1,direction:s.RANGE_DIRECTION.FORWARD}]})}},ie="docs.quick.insert.keyword-input-placeholder",H=()=>{const i=p.useDependency(s.LocaleService);return m.jsx("div",{className:"univer-translate-y-1.5 univer-text-sm univer-text-gray-500",children:i.t("docQuickInsert.keywordInputPlaceholder")})};H.componentKey=ie;const re={type:s.CommandType.OPERATION,id:"doc.operation.show-quick-insert-popup",handler(i,n){const e=i.get(c.DocQuickInsertPopupService);return n?(e.showPopup(n),!0):!1}},U={type:s.CommandType.OPERATION,id:"doc.operation.close-quick-insert-popup",handler(i){return i.get(c.DocQuickInsertPopupService).closePopup(),!0}},se="docs.quick.insert.placeholder",L=()=>{const i=p.useDependency(s.LocaleService);return m.jsx("div",{className:"univer-flex univer-h-full univer-items-center univer-justify-center univer-rounded-lg univer-bg-white univer-px-12 univer-py-6 univer-text-gray-400 univer-shadow-lg",children:m.jsx("span",{children:i.t("docQuickInsert.placeholder")})})};L.componentKey=se;function F(i,n){return i.map(e=>({...e})).filter(e=>{if("children"in e)return e.children=F(e.children,n),e.children.length>0;const t=e.keywords;return t?t.some(r=>r.includes(n)):e.title.toLowerCase().includes(n)})}function oe(i,n){return i.map(e=>{const t={...e};return"children"in t&&(t.children=oe(t.children,n)),t.title=n.t(t.title),"keywords"in t&&(t.keywords=t.keywords.concat(t.title).map(r=>r.toLowerCase())),t})}const ye=[p.KeyCode.ARROW_UP,p.KeyCode.ARROW_DOWN,p.KeyCode.ENTER],q=()=>{const i=p.useDependency(s.LocaleService),n=p.useDependency(c.DocQuickInsertPopupService),e=p.useDependency(p.ComponentManager),t=p.useDependency(p.IShortcutService),r=p.useDependency(s.ICommandService),o=f.useMemo(()=>s.generateRandomId(),[]),[u,v]=f.useState(0),I=f.useRef(null),a=f.useRef(0);a.current=0;const d=p.useObservable(n.filterKeyword$,""),l=p.useObservable(n.editPopup$),h=p.useObservable(l==null?void 0:l.popup.menus$,[]),O=f.useMemo(()=>oe(h,i),[h]),[M,T]=f.useState(()=>F(O,d.toLowerCase()));f.useEffect(()=>{const _=requestIdleCallback(()=>{T(F(O,d.toLowerCase()))});return()=>{cancelIdleCallback(_)}},[O,d]);const b=_=>{n.emitMenuSelected(_),r.executeCommand(U.id)};f.useEffect(()=>{const _=new s.DisposableCollection;t.getAllShortcuts().filter(g=>g.binding&&ye.includes(g.binding)).forEach(g=>{const x=g.preconditions;g.preconditions=()=>!1,_.add(s.toDisposable(()=>{g.preconditions=x}))});const w={id:`quick.insert.popup.enter.${o}`,type:s.CommandType.OPERATION,handler:()=>{const g=I.current;g&&b(g)}},K={id:`quick.insert.popup.move.cursor.up.${o}`,type:s.CommandType.OPERATION,handler:()=>{v(g=>{const x=g-1;return x>=0?x:a.current-1})}},Q={id:`quick.insert.popup.move.cursor.down.${o}`,type:s.CommandType.OPERATION,handler:()=>{v(g=>{const x=g+1;return x<=a.current-1?x:0})}};return _.add(r.registerCommand(K)),_.add(r.registerCommand(Q)),_.add(r.registerCommand(w)),_.add(t.registerShortcut({priority:1e3,id:K.id,binding:p.KeyCode.ARROW_UP,preconditions:()=>!0,staticParameters:{direction:s.Direction.UP}})),_.add(t.registerShortcut({priority:1e3,id:Q.id,binding:p.KeyCode.ARROW_DOWN,preconditions:()=>!0,staticParameters:{direction:s.Direction.DOWN}})),_.add(t.registerShortcut({priority:1e3,id:w.id,binding:p.KeyCode.ENTER,preconditions:()=>!0})),()=>{_.dispose()}},[]),f.useEffect(()=>{v(0)},[M]);const W=f.useRef(new Map);f.useEffect(()=>()=>{W.current.clear()},[]);function N(_){return _.map(y=>{const ee=y.icon,w=ee?e.get(ee):null;if("children"in y)return m.jsx(k.MenuItemGroup,{title:m.jsxs("div",{className:"univer-mb-2 univer-flex univer-items-center univer-text-xs univer-text-gray-400",children:[w&&m.jsx("span",{className:"univer-mr-2 univer-inline-flex univer-text-base",children:m.jsx(w,{})}),m.jsx("span",{children:y.title})]}),children:N(y.children)},y.id);const K=a.current,Q=u===K;if(Q){I.current=y;const g=W.current.get(y.id);g==null||g.scrollIntoView({block:"nearest"})}return a.current++,m.jsx(k.MenuItem,{ref:g=>{g&&W.current.set(y.id,g)},onMouseEnter:()=>v(K),onMouseLeave:()=>v(Number.NaN),className:k.clsx("univer-w-[calc(220px-var(--padding-base)*2)] univer-text-sm",{"hover:univer-bg-transparent":!Q,"univer-bg-gray-100":Q}),onClick:()=>{b(y)},children:m.jsxs("div",{className:"univer-flex univer-w-full univer-items-center univer-px-1",children:[w&&m.jsx("span",{className:"univer-mr-2 univer-inline-flex univer-text-base",children:m.jsx(w,{})}),m.jsx(k.Tooltip,{showIfEllipsis:!0,title:y.title,placement:"right",children:m.jsx("span",{className:"univer-truncate",children:y.title})})]})},y.id)})}const V=M.length>0,Ce=(l==null?void 0:l.popup.Placeholder)||e.get(L.componentKey);return m.jsx("div",{className:k.clsx("univer-mt-2"),children:V?m.jsx(k.Menu,{wrapperClass:"univer-max-h-[360px] univer-w-[220px] univer-overflow-y-auto univer-overflow-x-hidden",children:N(M)}):Ce&&m.jsx(Ce,{})})};q.componentKey="docs.quick.insert.popup";var Pe=Object.getOwnPropertyDescriptor,De=(i,n,e,t)=>{for(var r=t>1?void 0:t?Pe(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},j=(i,n)=>(e,t)=>n(e,t,i);const ce={dispose:()=>{}};c.DocQuickInsertPopupService=class extends s.Disposable{constructor(e,t,r,o,u){super();P(this,"_popups",new Set);P(this,"_editPopup$",new C.BehaviorSubject(void 0));P(this,"editPopup$",this._editPopup$.asObservable());P(this,"_isComposing$",new C.BehaviorSubject(!1));P(this,"isComposing$",this._isComposing$.asObservable());P(this,"_inputOffset$",new C.BehaviorSubject({start:0,end:0}));P(this,"inputOffset$",this._inputOffset$.asObservable());P(this,"filterKeyword$");P(this,"_menuSelectedCallbacks",new Set);P(this,"_inputPlaceholderRenderRoot",null);this._docCanvasPopupManagerService=e,this._univerInstanceService=t,this._commandService=r,this._renderManagerService=o,this._docSelectionManagerService=u,this.disposeWithMe(this._editPopup$);const v=(a,d)=>{var l,h;return(h=(l=this._univerInstanceService.getCurrentUnitOfType(s.UniverInstanceType.UNIVER_DOC))==null?void 0:l.getBody())==null?void 0:h.dataStream.slice(a,d)};let I="";this.filterKeyword$=this._inputOffset$.pipe(C.map(a=>{var l;const d=v(a.start,a.end);return(l=d==null?void 0:d.slice(1))!=null?l:""}),C.distinctUntilChanged(),C.tap(a=>{I=a})),this.disposeWithMe(C.combineLatest([this.filterKeyword$.pipe(C.tap(a=>{var d,l,h;a.length>0?(l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose():(h=this._inputPlaceholderRenderRoot)==null||h.mount()})),this.isComposing$.pipe(C.tap(a=>{var d,l,h;a?(l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose():I.length<=0&&((h=this._inputPlaceholderRenderRoot)==null||h.mount())})),this.editPopup$.pipe(C.tap(a=>{var d,l;a||((l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose(),this._inputPlaceholderRenderRoot=null)}))]).subscribe())}get popups(){return Array.from(this._popups)}get editPopup(){return this._editPopup$.value}get isComposing(){return this._isComposing$.value}setIsComposing(e){this._isComposing$.next(e)}get inputOffset(){return this._inputOffset$.value}setInputOffset(e){this._inputOffset$.next(e)}getDocEventManagerService(e){var t;return(t=this._renderManagerService.getRenderById(e))==null?void 0:t.with(S.DocEventManagerService)}resolvePopup(e){return Array.from(this._popups).find(t=>t.keyword===e)}registerPopup(e){return this._popups.add(e),()=>{this._popups.delete(e)}}_createInputPlaceholderRenderRoot(e){return{isMounted:!1,mount(){if(this.isMounted)return;this.isMounted=!0;const r=e();this.unmount={dispose:()=>{r.dispose(),this.isMounted=!1}}}}}showPopup(e){var l,h;const{popup:t,index:r,unitId:o}=e;this.closePopup();const u=this._univerInstanceService.getUnit(o),v=(h=(l=u==null?void 0:u.getBody())==null?void 0:l.paragraphs)==null?void 0:h.find(O=>O.startIndex>r);if(!v)return;const I=this.getDocEventManagerService(o),a=I==null?void 0:I.findParagraphBoundByIndex(v.startIndex);if(!a)return;this._inputPlaceholderRenderRoot=this._createInputPlaceholderRenderRoot(()=>{var V;const O=(V=this._renderManagerService.getRenderById(o))==null?void 0:V.with(E.DocSkeletonManagerService),M=this._docSelectionManagerService.getActiveTextRange();if(!O||!M)return ce;const b=O.getSkeleton().findNodeByCharIndex(M.startOffset,M.segmentId,M.segmentPage);if(!((b==null?void 0:b.content)==="\r"))return ce;const N=this._docCanvasPopupManagerService.attachPopupToRange({startOffset:r+1,endOffset:r+1,collapsed:!1},{componentKey:H.componentKey,onClickOutside:()=>{N.dispose()},direction:"horizontal"},o);return N}),this._inputPlaceholderRenderRoot.mount();const d=this._docCanvasPopupManagerService.attachPopupToRect(a.firstLine,{componentKey:q.componentKey,onClickOutside:()=>{this.closePopup()},direction:"bottom"},o);this._editPopup$.next({disposable:d,popup:t,anchor:r,unitId:o})}closePopup(){this.editPopup&&(this.editPopup.disposable.dispose(),this._editPopup$.next(null))}onMenuSelected(e){return this._menuSelectedCallbacks.add(e),()=>{this._menuSelectedCallbacks.delete(e)}}emitMenuSelected(e){const{start:t,end:r}=this.inputOffset;this._commandService.syncExecuteCommand(ne.id,{start:t,end:r}),setTimeout(()=>{this._menuSelectedCallbacks.forEach(o=>o(e))},0)}},c.DocQuickInsertPopupService=De([j(0,s.Inject(S.DocCanvasPopManagerService)),j(1,s.Inject(s.IUniverInstanceService)),j(2,s.Inject(s.ICommandService)),j(3,s.Inject(z.IRenderManagerService)),j(4,s.Inject(E.DocSelectionManagerService))],c.DocQuickInsertPopupService);const ae="doc.quick-insert.button";var Oe=Object.getOwnPropertyDescriptor,Me=(i,n,e,t)=>{for(var r=t>1?void 0:t?Oe(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},G=(i,n)=>(e,t)=>n(e,t,i);let B=class extends s.Disposable{constructor(n,e,t,r){super();P(this,"_popup$",new C.BehaviorSubject(null));P(this,"popup$",this._popup$.asObservable());this._context=n,this._docEventManagerService=e,this._docQuickInsertPopupService=t,this._docCanvasPopManagerService=r,this._init()}get popup(){return this._popup$.value}_init(){this.disposeWithMe(C.combineLatest([this._docEventManagerService.hoverParagraphLeftRealTime$,this._docEventManagerService.hoverParagraphRealTime$]).subscribe(([n,e])=>{var o;const t=n!=null?n:e,r=this._context.unit.getDisabled();if(!t||r){this._hideMenu(!0);return}if(t.paragraphStart===t.paragraphEnd){if(this._docQuickInsertPopupService.editPopup||t.startIndex===((o=this.popup)==null?void 0:o.startIndex))return;this._hideMenu(!0);const u=this._docCanvasPopManagerService.attachPopupToRect(t.firstLine,{componentKey:ae,direction:"left-center"},this._context.unit.getUnitId());this._popup$.next({startIndex:t.startIndex,disposable:u})}else this._hideMenu(!0)}))}_hideMenu(n){this._docQuickInsertPopupService.editPopup||this.popup&&(n||this.popup.disposable.canDispose())&&(this.popup.disposable.dispose(),this._popup$.next(null))}};B=Me([G(1,s.Inject(S.DocEventManagerService)),G(2,s.Inject(c.DocQuickInsertPopupService)),G(3,s.Inject(S.DocCanvasPopManagerService))],B);const ue={id:"quick-insert.text.menu",title:"docQuickInsert.menu.text",icon:"TextSingle",keywords:["text"]},de={id:S.OrderListCommand.id,title:"docQuickInsert.menu.numberedList",icon:"OrderSingle",keywords:["numbered","list","ordered"]},pe={id:S.BulletListCommand.id,title:"docQuickInsert.menu.bulletedList",icon:"UnorderSingle",keywords:["bulleted","list","unordered"]},le={id:S.HorizontalLineCommand.id,title:"docQuickInsert.menu.divider",icon:"DividerSingle",keywords:["divider","line","separate"]},ve={id:S.DocCreateTableOperation.id,title:"docQuickInsert.menu.table",icon:"GridSingle",keywords:["table","grid","spreadsheet"]},he={id:te.InsertDocImageCommand.id,title:"docQuickInsert.menu.image",icon:"addition-and-subtraction-single",keywords:["image","picture","photo"]},be=[{title:"docQuickInsert.group.basics",id:"quick.insert.group.basic",children:[ue,de,pe,le,ve,he]}],ke=new Set([de.id,pe.id,le.id,ve.id,he.id]);var we=Object.getOwnPropertyDescriptor,xe=(i,n,e,t)=>{for(var r=t>1?void 0:t?we(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},$=(i,n)=>(e,t)=>n(e,t,i);c.DocQuickInsertTriggerController=class extends s.Disposable{constructor(n,e,t,r,o){super(),this._commandService=n,this._textSelectionManagerService=e,this._docQuickInsertPopupService=t,this._shortcutService=r,this._univerInstanceService=o,this.disposeWithMe(this._shortcutService.registerShortcut({id:U.id,binding:p.KeyCode.ESC,preconditions:()=>!!this._docQuickInsertPopupService.editPopup,priority:1e3})),this._initTrigger(),this._initMenuHandler()}_initTrigger(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{var u,v,I;const{_docQuickInsertPopupService:e,_textSelectionManagerService:t,_commandService:r}=this,o=this._univerInstanceService.getCurrentUnitOfType(s.UniverInstanceType.UNIVER_DOC);if(!(o!=null&&o.getDisabled())){if(n.id===S.InsertCommand.id){const a=n.params;if(e.editPopup){e.setInputOffset({start:e.inputOffset.start,end:a.range.endOffset+1});return}const d=t.getActiveTextRange();if(!d)return;const l=e.resolvePopup(a.body.dataStream);if(!l||!(l.preconditions?l.preconditions(a):!0))return;e.setInputOffset({start:d.startOffset-1,end:d.startOffset}),setTimeout(()=>{r.executeCommand(re.id,{index:d.startOffset-1,unitId:a.unitId,popup:l})},100)}if(n.id===S.IMEInputCommand.id){const a=n.params;!e.isComposing&&a.isCompositionStart&&e.setIsComposing(!0),e.isComposing&&a.isCompositionEnd&&e.setIsComposing(!1)}if(n.id===E.RichTextEditingMutation.id){const a=n.params;if(a.isCompositionEnd){const d=(v=(u=a.textRanges)==null?void 0:u[0])==null?void 0:v.endOffset;d&&e.setInputOffset({start:e.inputOffset.start,end:d})}}if(n.id===S.DeleteCommand.id){const a=n.params;if(e.editPopup&&a.direction===s.DeleteDirection.LEFT){const d=(I=a.len)!=null?I:0;e.setInputOffset({start:e.inputOffset.start,end:a.range.endOffset-d})}}if(n.id===S.MoveCursorOperation.id){const a=n.params;(a.direction===s.Direction.LEFT||a.direction===s.Direction.RIGHT)&&e.editPopup&&r.executeCommand(U.id)}if(n.id===S.DeleteLeftCommand.id){const a=t.getActiveTextRange();if(!e.editPopup||!a)return;a.endOffset<=e.editPopup.anchor&&r.executeCommand(U.id)}}}))}_initMenuHandler(){this.disposeWithMe(this._docQuickInsertPopupService.onMenuSelected(n=>{n.id!==ue.id&&ke.has(n.id)&&this._commandService.executeCommand(n.id)}))}},c.DocQuickInsertTriggerController=xe([$(0,s.ICommandService),$(1,s.Inject(E.DocSelectionManagerService)),$(2,s.Inject(c.DocQuickInsertPopupService)),$(3,s.Inject(p.IShortcutService)),$(4,s.Inject(s.IUniverInstanceService))],c.DocQuickInsertTriggerController);var D=function(){return D=Object.assign||function(i){for(var n,e=1,t=arguments.length;e<t;e++){n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},D.apply(this,arguments)},Re=function(i,n){var e={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&n.indexOf(t)<0&&(e[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,t=Object.getOwnPropertySymbols(i);r<t.length;r++)n.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(i,t[r])&&(e[t[r]]=i[t[r]]);return e},A=f.forwardRef(function(i,n){var e=i.icon,t=i.id,r=i.className,o=i.extend,u=Re(i,["icon","id","className","extend"]),v="univerjs-icon univerjs-icon-".concat(t," ").concat(r||"").trim(),I=f.useRef("_".concat(Ue()));return fe(e,"".concat(t),{defIds:e.defIds,idSuffix:I.current},D({ref:n,className:v},u),o)});function fe(i,n,e,t,r){return f.createElement(i.tag,D(D({key:n},Qe(i,e,r)),t),(Ee(i,e).children||[]).map(function(o,u){return fe(o,"".concat(n,"-").concat(i.tag,"-").concat(u),e,void 0,r)}))}function Qe(i,n,e){var t=D({},i.attrs);e!=null&&e.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=e.colorChannel1),i.tag==="mask"&&t.id&&(t.id=t.id+n.idSuffix),Object.entries(t).forEach(function(o){var u=o[0],v=o[1];u==="mask"&&typeof v=="string"&&(t[u]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))});var r=n.defIds;return!r||r.length===0||(i.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+n.idSuffix),Object.entries(t).forEach(function(o){var u=o[0],v=o[1];typeof v=="string"&&(t[u]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))})),t}function Ee(i,n){var e,t=n.defIds;return!t||t.length===0?i:i.tag==="defs"&&(!((e=i.children)===null||e===void 0)&&e.length)?D(D({},i),{children:i.children.map(function(r){return typeof r.attrs.id=="string"&&t&&t.indexOf(r.attrs.id)>-1?D(D({},r),{attrs:D(D({},r.attrs),{id:r.attrs.id+n.idSuffix})}):r})}):i}function Ue(){return Math.random().toString(36).substring(2,8)}A.displayName="UniverIcon";var je={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.01953 3.13985C1.01953 2.77258 1.31726 2.47485 1.68453 2.47485H2.73713C3.1044 2.47485 3.40213 2.77258 3.40213 3.13985 3.40213 3.50712 3.1044 3.80485 2.73713 3.80485H1.68453C1.31726 3.80485 1.01953 3.50712 1.01953 3.13985zM4.17734 3.13985C4.17734 2.77258 4.47507 2.47485 4.84234 2.47485H6.94754C7.31481 2.47485 7.61254 2.77258 7.61254 3.13985 7.61254 3.50712 7.31481 3.80485 6.94754 3.80485H4.84234C4.47507 3.80485 4.17734 3.50712 4.17734 3.13985zM8.38775 3.13985C8.38775 2.77258 8.68548 2.47485 9.05275 2.47485H11.158C11.5252 2.47485 11.823 2.77258 11.823 3.13985 11.823 3.50712 11.5252 3.80485 11.158 3.80485H9.05275C8.68548 3.80485 8.38775 3.50712 8.38775 3.13985zM12.5982 3.13985C12.5982 2.77258 12.8959 2.47485 13.2632 2.47485H14.3158C14.683 2.47485 14.9808 2.77258 14.9808 3.13985 14.9808 3.50712 14.683 3.80485 14.3158 3.80485H13.2632C12.8959 3.80485 12.5982 3.50712 12.5982 3.13985zM1.01953 7.99972C1.01953 7.63245 1.31726 7.33472 1.68453 7.33472H14.3158C14.683 7.33472 14.9808 7.63245 14.9808 7.99972 14.9808 8.36699 14.683 8.66472 14.3158 8.66472H1.68453C1.31726 8.66472 1.01953 8.36699 1.01953 7.99972zM1.68453 12.1951C1.31726 12.1951 1.01953 12.4928 1.01953 12.8601 1.01953 13.2273 1.31726 13.5251 1.68453 13.5251H2.73713C3.1044 13.5251 3.40213 13.2273 3.40213 12.8601 3.40213 12.4928 3.1044 12.1951 2.73713 12.1951H1.68453zM4.84234 12.1951C4.47507 12.1951 4.17734 12.4928 4.17734 12.8601 4.17734 13.2273 4.47507 13.5251 4.84234 13.5251H6.94754C7.31481 13.5251 7.61254 13.2273 7.61254 12.8601 7.61254 12.4928 7.31481 12.1951 6.94754 12.1951H4.84234zM9.05275 12.1951C8.68548 12.1951 8.38775 12.4928 8.38775 12.8601 8.38775 13.2273 8.68548 13.5251 9.05275 13.5251H11.158C11.5252 13.5251 11.823 13.2273 11.823 12.8601 11.823 12.4928 11.5252 12.1951 11.158 12.1951H9.05275zM13.2632 12.1951C12.8959 12.1951 12.5982 12.4928 12.5982 12.8601 12.5982 13.2273 12.8959 13.5251 13.2632 13.5251H14.3158C14.683 13.5251 14.9808 13.2273 14.9808 12.8601 14.9808 12.4928 14.683 12.1951 14.3158 12.1951H13.2632z"}}]},Z=f.forwardRef(function(i,n){return f.createElement(A,Object.assign({},i,{id:"divider-single",ref:n,icon:je}))});Z.displayName="DividerSingle";var $e={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.00033 2.66699C8.36852 2.66699 8.66699 2.96547 8.66699 3.33366V7.33366H12.667C13.0352 7.33366 13.3337 7.63214 13.3337 8.00033C13.3337 8.36852 13.0352 8.66699 12.667 8.66699H8.66699V12.667C8.66699 13.0352 8.36852 13.3337 8.00033 13.3337C7.63214 13.3337 7.33366 13.0352 7.33366 12.667V8.66699H3.33366C2.96547 8.66699 2.66699 8.36852 2.66699 8.00033C2.66699 7.63214 2.96547 7.33366 3.33366 7.33366H7.33366V3.33366C7.33366 2.96547 7.63214 2.66699 8.00033 2.66699Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ge=f.forwardRef(function(i,n){return f.createElement(A,Object.assign({},i,{id:"plus-single",ref:n,icon:$e}))});ge.displayName="PlusSingle";var Te={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.66695 1.33496C2.29968 1.33496 2.00195 1.63269 2.00195 1.99996V3.64439C2.00195 4.01166 2.29968 4.30939 2.66695 4.30939C3.03422 4.30939 3.33195 4.01166 3.33195 3.64439V2.66496H7.33521V13.335H5.3337C4.96643 13.335 4.6687 13.6327 4.6687 14C4.6687 14.3672 4.96643 14.665 5.3337 14.665H10.667C11.0343 14.665 11.332 14.3672 11.332 14C11.332 13.6327 11.0343 13.335 10.667 13.335H8.66521V2.66496H12.6686V3.64439C12.6686 4.01166 12.9664 4.30939 13.3336 4.30939C13.7009 4.30939 13.9986 4.01166 13.9986 3.64439V1.99996C13.9986 1.63269 13.7009 1.33496 13.3336 1.33496H2.66695Z"}}]},J=f.forwardRef(function(i,n){return f.createElement(A,Object.assign({},i,{id:"text-single",ref:n,icon:Te}))});J.displayName="TextSingle";const X=({className:i=""})=>{const n=p.useDependency(c.DocQuickInsertPopupService),e=p.useDependency(s.IUniverInstanceService),t=p.useDependency(z.IRenderManagerService),r=p.useObservable(f.useMemo(()=>e.getCurrentTypeOfUnit$(s.UniverInstanceType.UNIVER_DOC),[e])),o=r&&t.getRenderById(r.getUnitId()),u=o==null?void 0:o.with(B),v=p.useDependency(p.ILayoutService),I=p.useDependency(E.DocSelectionManagerService),a=p.useObservable(n.editPopup$),d=p.useEvent(l=>{var T;const h=u==null?void 0:u.popup;if(!h)return;const O=n.popups,M={keyword:"",menus$:C.combineLatest(O.map(b=>b.menus$)).pipe(C.map(b=>b.flat()))};I.replaceDocRanges([{startOffset:h.startIndex,endOffset:h.startIndex}]),n.setInputOffset({start:h.startIndex-1,end:h.startIndex-1}),n.showPopup({popup:M,index:h.startIndex-1,unitId:(T=r==null?void 0:r.getUnitId())!=null?T:""}),setTimeout(()=>{v.focus()})});return m.jsx("div",{className:k.clsx("univer-mr-1 univer-flex univer-cursor-pointer univer-items-center univer-gap-2.5 univer-rounded-full univer-p-1.5 univer-shadow-sm hover:univer-bg-gray-100",k.borderClassName,{"univer-bg-gray-100":a,"univer-bg-white":!a},i),role:"button",tabIndex:0,onClick:d,children:m.jsx(ge,{className:"univer-text-gray-800"})})};X.componentKey=ae;var Ne=Object.getOwnPropertyDescriptor,Ke=(i,n,e,t)=>{for(var r=t>1?void 0:t?Ne(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},Y=(i,n)=>(e,t)=>n(e,t,i);c.DocQuickInsertUIController=class extends s.Disposable{constructor(n,e,t){super(),this._commandService=n,this._docQuickInsertPopupService=e,this._componentManager=t,this._initCommands(),this._initComponents(),this._initMenus()}_initCommands(){[ne,re,U].forEach(n=>{this.disposeWithMe(this._commandService.registerCommand(n))})}_initComponents(){[[q.componentKey,q],[H.componentKey,H],[L.componentKey,L],[Z.displayName,Z],[J.displayName,J],[X.componentKey,X]].forEach(([e,t])=>{e&&this.disposeWithMe(this._componentManager.register(e,t))}),[{keyword:"/",menus$:C.of(be),preconditions:e=>{var t;return((t=e.range.startNodePosition)==null?void 0:t.glyph)===0}}].forEach(e=>{this.disposeWithMe(this._docQuickInsertPopupService.registerPopup(e))})}_initMenus(){}},c.DocQuickInsertUIController=Ke([Y(0,s.ICommandService),Y(1,s.Inject(c.DocQuickInsertPopupService)),Y(2,s.Inject(p.ComponentManager))],c.DocQuickInsertUIController);var He=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,qe=(i,n,e)=>n in i?He(i,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[n]=e,Be=(i,n,e,t)=>{for(var r=t>1?void 0:t?Le(n,e):n,o=i.length-1,u;o>=0;o--)(u=i[o])&&(r=u(r)||r);return r},me=(i,n)=>(e,t)=>n(e,t,i),Ie=(i,n,e)=>qe(i,typeof n!="symbol"?n+"":n,e);const Ae="DOC_QUICK_INSERT_UI_PLUGIN";c.UniverDocsQuickInsertUIPlugin=class extends s.Plugin{constructor(n,e){super(),this._injector=n,this._renderManagerSrv=e}onStarting(){[[c.DocQuickInsertUIController],[c.DocQuickInsertTriggerController],[c.DocQuickInsertPopupService]].forEach(e=>this._injector.add(e)),this._injector.get(c.DocQuickInsertUIController)}onRendered(){this._injector.get(c.DocQuickInsertTriggerController),this._injector.get(c.DocQuickInsertPopupService),[[B]].forEach(n=>{this._renderManagerSrv.registerRenderModule(s.UniverInstanceType.UNIVER_DOC,n)})}},Ie(c.UniverDocsQuickInsertUIPlugin,"type",s.UniverInstanceType.UNIVER_DOC),Ie(c.UniverDocsQuickInsertUIPlugin,"pluginName",Ae),c.UniverDocsQuickInsertUIPlugin=Be([s.DependentOn(_e.UniverDrawingUIPlugin,Se.UniverDrawingPlugin,te.UniverDocsDrawingUIPlugin,R.UniverDocsDrawingPlugin,p.UniverUIPlugin),me(0,s.Inject(s.Injector)),me(1,s.Inject(z.IRenderManagerService))],c.UniverDocsQuickInsertUIPlugin),c.KeywordInputPlaceholderComponentKey=ie,c.QuickInsertPlaceholderComponentKey=se,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(c,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/docs-drawing"),require("@univerjs/docs-drawing-ui"),require("@univerjs/drawing"),require("@univerjs/drawing-ui"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("@univerjs/docs-ui"),require("rxjs"),require("@univerjs/docs"),require("react/jsx-runtime"),require("@univerjs/design"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs-drawing","@univerjs/docs-drawing-ui","@univerjs/drawing","@univerjs/drawing-ui","@univerjs/engine-render","@univerjs/ui","@univerjs/docs-ui","rxjs","@univerjs/docs","react/jsx-runtime","@univerjs/design","react"],s):(c=typeof globalThis<"u"?globalThis:c||self,s(c.UniverDocsQuickInsertUi={},c.UniverCore,c.UniverDocsDrawing,c.UniverDocsDrawingUi,c.UniverDrawing,c.UniverDrawingUi,c.UniverEngineRender,c.UniverUi,c.UniverDocsUi,c.rxjs,c.UniverDocs,c.React,c.UniverDesign,c.React))})(this,function(c,s,R,te,_e,ye,V,p,_,C,E,m,b,f){"use strict";var We=Object.defineProperty;var Ze=(c,s,R)=>s in c?We(c,s,{enumerable:!0,configurable:!0,writable:!0,value:R}):c[s]=R;var P=(c,s,R)=>Ze(c,typeof s!="symbol"?s+"":s,R);const ne={id:"doc.command.delete-search-key",type:s.CommandType.COMMAND,handler:(r,n)=>{const e=r.get(s.ICommandService),{start:t,end:i}=n;return e.syncExecuteCommand(_.CutContentCommand.id,{segmentId:"",textRanges:[{startOffset:t,endOffset:t,collapsed:!0}],selections:[{startOffset:t,endOffset:i,collapsed:!1,direction:s.RANGE_DIRECTION.FORWARD}]})}},re="docs.quick.insert.keyword-input-placeholder",H=()=>{const r=p.useDependency(s.LocaleService);return m.jsx("div",{className:"univer-translate-y-1.5 univer-text-sm univer-text-gray-500",children:r.t("docQuickInsert.keywordInputPlaceholder")})};H.componentKey=re;const ie={type:s.CommandType.OPERATION,id:"doc.operation.show-quick-insert-popup",handler(r,n){const e=r.get(c.DocQuickInsertPopupService);return n?(e.showPopup(n),!0):!1}},U={type:s.CommandType.OPERATION,id:"doc.operation.close-quick-insert-popup",handler(r){return r.get(c.DocQuickInsertPopupService).closePopup(),!0}},se="docs.quick.insert.placeholder",L=()=>{const r=p.useDependency(s.LocaleService);return m.jsx("div",{className:"univer-flex univer-h-full univer-items-center univer-justify-center univer-rounded-lg univer-bg-white univer-px-12 univer-py-6 univer-text-gray-400 univer-shadow-lg",children:m.jsx("span",{children:r.t("docQuickInsert.placeholder")})})};L.componentKey=se;function F(r,n){return r.map(e=>({...e})).filter(e=>{if("children"in e)return e.children=F(e.children,n),e.children.length>0;const t=e.keywords;return t?t.some(i=>i.includes(n)):e.title.toLowerCase().includes(n)})}function oe(r,n){return r.map(e=>{const t={...e};return"children"in t&&(t.children=oe(t.children,n)),t.title=n.t(t.title),"keywords"in t&&(t.keywords=t.keywords.concat(t.title).map(i=>i.toLowerCase())),t})}const Se=[p.KeyCode.ARROW_UP,p.KeyCode.ARROW_DOWN,p.KeyCode.ENTER],q=()=>{const r=p.useDependency(s.LocaleService),n=p.useDependency(c.DocQuickInsertPopupService),e=p.useDependency(p.ComponentManager),t=p.useDependency(p.IShortcutService),i=p.useDependency(s.ICommandService),o=f.useMemo(()=>s.generateRandomId(),[]),[u,v]=f.useState(0),I=f.useRef(null),a=f.useRef(0);a.current=0;const d=p.useObservable(n.filterKeyword$,""),l=p.useObservable(n.editPopup$),h=p.useObservable(l==null?void 0:l.popup.menus$,[]),O=f.useMemo(()=>oe(h,r),[h]),[w,T]=f.useState(()=>F(O,d.toLowerCase()));f.useEffect(()=>{const y=requestIdleCallback(()=>{T(F(O,d.toLowerCase()))});return()=>{cancelIdleCallback(y)}},[O,d]);const M=y=>{n.emitMenuSelected(y),i.executeCommand(U.id)};f.useEffect(()=>{const y=new s.DisposableCollection;t.getAllShortcuts().filter(g=>g.binding&&Se.includes(g.binding)).forEach(g=>{const x=g.preconditions;g.preconditions=()=>!1,y.add(s.toDisposable(()=>{g.preconditions=x}))});const k={id:`quick.insert.popup.enter.${o}`,type:s.CommandType.OPERATION,handler:()=>{const g=I.current;g&&M(g)}},K={id:`quick.insert.popup.move.cursor.up.${o}`,type:s.CommandType.OPERATION,handler:()=>{v(g=>{const x=g-1;return x>=0?x:a.current-1})}},Q={id:`quick.insert.popup.move.cursor.down.${o}`,type:s.CommandType.OPERATION,handler:()=>{v(g=>{const x=g+1;return x<=a.current-1?x:0})}};return y.add(i.registerCommand(K)),y.add(i.registerCommand(Q)),y.add(i.registerCommand(k)),y.add(t.registerShortcut({priority:1e3,id:K.id,binding:p.KeyCode.ARROW_UP,preconditions:()=>!0,staticParameters:{direction:s.Direction.UP}})),y.add(t.registerShortcut({priority:1e3,id:Q.id,binding:p.KeyCode.ARROW_DOWN,preconditions:()=>!0,staticParameters:{direction:s.Direction.DOWN}})),y.add(t.registerShortcut({priority:1e3,id:k.id,binding:p.KeyCode.ENTER,preconditions:()=>!0})),()=>{y.dispose()}},[]),f.useEffect(()=>{v(0)},[w]);const W=f.useRef(new Map);f.useEffect(()=>()=>{W.current.clear()},[]);function N(y){return y.map(S=>{const ee=S.icon,k=ee?e.get(ee):null;if("children"in S)return m.jsx(b.MenuItemGroup,{title:m.jsxs("div",{className:"univer-mb-2 univer-flex univer-items-center univer-text-xs univer-text-gray-400",children:[k&&m.jsx("span",{className:"univer-mr-2 univer-inline-flex univer-text-base",children:m.jsx(k,{})}),m.jsx("span",{children:S.title})]}),children:N(S.children)},S.id);const K=a.current,Q=u===K;if(Q){I.current=S;const g=W.current.get(S.id);g==null||g.scrollIntoView({block:"nearest"})}return a.current++,m.jsx(b.MenuItem,{ref:g=>{g&&W.current.set(S.id,g)},onMouseEnter:()=>v(K),onMouseLeave:()=>v(Number.NaN),className:b.clsx("univer-w-[calc(220px-var(--padding-base)*2)] univer-text-sm",{"hover:univer-bg-transparent":!Q,"univer-bg-gray-100 dark:!univer-bg-gray-500":Q}),onClick:()=>{M(S)},children:m.jsxs("div",{className:"univer-flex univer-w-full univer-items-center univer-px-1",children:[k&&m.jsx("span",{className:"univer-mr-2 univer-inline-flex univer-text-base",children:m.jsx(k,{})}),m.jsx(b.Tooltip,{showIfEllipsis:!0,title:S.title,placement:"right",children:m.jsx("span",{className:"univer-truncate",children:S.title})})]})},S.id)})}const Z=w.length>0,Ce=(l==null?void 0:l.popup.Placeholder)||e.get(L.componentKey);return m.jsx("div",{className:"univer-mt-2",children:Z?m.jsx(b.Menu,{wrapperClass:b.clsx("univer-max-h-[360px] univer-w-[220px] univer-overflow-y-auto univer-overflow-x-hidden",b.scrollbarClassName),children:N(w)}):Ce&&m.jsx(Ce,{})})};q.componentKey="docs.quick.insert.popup";var Pe=Object.getOwnPropertyDescriptor,De=(r,n,e,t)=>{for(var i=t>1?void 0:t?Pe(n,e):n,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},j=(r,n)=>(e,t)=>n(e,t,r);const ce={dispose:()=>{}};c.DocQuickInsertPopupService=class extends s.Disposable{constructor(e,t,i,o,u){super();P(this,"_popups",new Set);P(this,"_editPopup$",new C.BehaviorSubject(void 0));P(this,"editPopup$",this._editPopup$.asObservable());P(this,"_isComposing$",new C.BehaviorSubject(!1));P(this,"isComposing$",this._isComposing$.asObservable());P(this,"_inputOffset$",new C.BehaviorSubject({start:0,end:0}));P(this,"inputOffset$",this._inputOffset$.asObservable());P(this,"filterKeyword$");P(this,"_menuSelectedCallbacks",new Set);P(this,"_inputPlaceholderRenderRoot",null);this._docCanvasPopupManagerService=e,this._univerInstanceService=t,this._commandService=i,this._renderManagerService=o,this._docSelectionManagerService=u,this.disposeWithMe(this._editPopup$);const v=(a,d)=>{var l,h;return(h=(l=this._univerInstanceService.getCurrentUnitOfType(s.UniverInstanceType.UNIVER_DOC))==null?void 0:l.getBody())==null?void 0:h.dataStream.slice(a,d)};let I="";this.filterKeyword$=this._inputOffset$.pipe(C.map(a=>{var l;const d=v(a.start,a.end);return(l=d==null?void 0:d.slice(1))!=null?l:""}),C.distinctUntilChanged(),C.tap(a=>{I=a})),this.disposeWithMe(C.combineLatest([this.filterKeyword$.pipe(C.tap(a=>{var d,l,h;a.length>0?(l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose():(h=this._inputPlaceholderRenderRoot)==null||h.mount()})),this.isComposing$.pipe(C.tap(a=>{var d,l,h;a?(l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose():I.length<=0&&((h=this._inputPlaceholderRenderRoot)==null||h.mount())})),this.editPopup$.pipe(C.tap(a=>{var d,l;a||((l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose(),this._inputPlaceholderRenderRoot=null)}))]).subscribe())}get popups(){return Array.from(this._popups)}get editPopup(){return this._editPopup$.value}get isComposing(){return this._isComposing$.value}setIsComposing(e){this._isComposing$.next(e)}get inputOffset(){return this._inputOffset$.value}setInputOffset(e){this._inputOffset$.next(e)}getDocEventManagerService(e){var t;return(t=this._renderManagerService.getRenderById(e))==null?void 0:t.with(_.DocEventManagerService)}resolvePopup(e){return Array.from(this._popups).find(t=>t.keyword===e)}registerPopup(e){return this._popups.add(e),()=>{this._popups.delete(e)}}_createInputPlaceholderRenderRoot(e){return{isMounted:!1,mount(){if(this.isMounted)return;this.isMounted=!0;const i=e();this.unmount={dispose:()=>{i.dispose(),this.isMounted=!1}}}}}showPopup(e){var l,h;const{popup:t,index:i,unitId:o}=e;this.closePopup();const u=this._univerInstanceService.getUnit(o),v=(h=(l=u==null?void 0:u.getBody())==null?void 0:l.paragraphs)==null?void 0:h.find(O=>O.startIndex>i);if(!v)return;const I=this.getDocEventManagerService(o),a=I==null?void 0:I.findParagraphBoundByIndex(v.startIndex);if(!a)return;this._inputPlaceholderRenderRoot=this._createInputPlaceholderRenderRoot(()=>{var Z;const O=(Z=this._renderManagerService.getRenderById(o))==null?void 0:Z.with(E.DocSkeletonManagerService),w=this._docSelectionManagerService.getActiveTextRange();if(!O||!w)return ce;const M=O.getSkeleton().findNodeByCharIndex(w.startOffset,w.segmentId,w.segmentPage);if(!((M==null?void 0:M.content)==="\r"))return ce;const N=this._docCanvasPopupManagerService.attachPopupToRange({startOffset:i+1,endOffset:i+1,collapsed:!1},{componentKey:H.componentKey,onClickOutside:()=>{N.dispose()},direction:"horizontal"},o);return N}),this._inputPlaceholderRenderRoot.mount();const d=this._docCanvasPopupManagerService.attachPopupToRect(a.firstLine,{componentKey:q.componentKey,onClickOutside:()=>{this.closePopup()},direction:"bottom"},o);this._editPopup$.next({disposable:d,popup:t,anchor:i,unitId:o})}closePopup(){this.editPopup&&(this.editPopup.disposable.dispose(),this._editPopup$.next(null))}onMenuSelected(e){return this._menuSelectedCallbacks.add(e),()=>{this._menuSelectedCallbacks.delete(e)}}emitMenuSelected(e){const{start:t,end:i}=this.inputOffset;this._commandService.syncExecuteCommand(ne.id,{start:t,end:i}),setTimeout(()=>{this._menuSelectedCallbacks.forEach(o=>o(e))},0)}},c.DocQuickInsertPopupService=De([j(0,s.Inject(_.DocCanvasPopManagerService)),j(1,s.Inject(s.IUniverInstanceService)),j(2,s.Inject(s.ICommandService)),j(3,s.Inject(V.IRenderManagerService)),j(4,s.Inject(E.DocSelectionManagerService))],c.DocQuickInsertPopupService);const ae="doc.quick-insert.button";var Oe=Object.getOwnPropertyDescriptor,we=(r,n,e,t)=>{for(var i=t>1?void 0:t?Oe(n,e):n,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},G=(r,n)=>(e,t)=>n(e,t,r);let A=class extends s.Disposable{constructor(n,e,t,i){super();P(this,"_popup$",new C.BehaviorSubject(null));P(this,"popup$",this._popup$.asObservable());this._context=n,this._docEventManagerService=e,this._docQuickInsertPopupService=t,this._docCanvasPopManagerService=i,this._init()}get popup(){return this._popup$.value}_init(){this.disposeWithMe(C.combineLatest([this._docEventManagerService.hoverParagraphLeftRealTime$,this._docEventManagerService.hoverParagraphRealTime$]).subscribe(([n,e])=>{var o;const t=n!=null?n:e,i=this._context.unit.getDisabled();if(!t||i){this._hideMenu(!0);return}if(t.paragraphStart===t.paragraphEnd){if(this._docQuickInsertPopupService.editPopup||t.startIndex===((o=this.popup)==null?void 0:o.startIndex))return;this._hideMenu(!0);const u=this._docCanvasPopManagerService.attachPopupToRect(t.firstLine,{componentKey:ae,direction:"left-center"},this._context.unit.getUnitId());this._popup$.next({startIndex:t.startIndex,disposable:u})}else this._hideMenu(!0)}))}_hideMenu(n){this._docQuickInsertPopupService.editPopup||this.popup&&(n||this.popup.disposable.canDispose())&&(this.popup.disposable.dispose(),this._popup$.next(null))}};A=we([G(1,s.Inject(_.DocEventManagerService)),G(2,s.Inject(c.DocQuickInsertPopupService)),G(3,s.Inject(_.DocCanvasPopManagerService))],A);const ue={id:"quick-insert.text.menu",title:"docQuickInsert.menu.text",icon:"TextIcon",keywords:["text"]},de={id:_.OrderListCommand.id,title:"docQuickInsert.menu.numberedList",icon:"OrderIcon",keywords:["numbered","list","ordered"]},pe={id:_.BulletListCommand.id,title:"docQuickInsert.menu.bulletedList",icon:"UnorderIcon",keywords:["bulleted","list","unordered"]},le={id:_.HorizontalLineCommand.id,title:"docQuickInsert.menu.divider",icon:"DividerIcon",keywords:["divider","line","separate"]},ve={id:_.DocCreateTableOperation.id,title:"docQuickInsert.menu.table",icon:"GridIcon",keywords:["table","grid","spreadsheet"]},he={id:te.InsertDocImageCommand.id,title:"docQuickInsert.menu.image",icon:"AdditionAndSubtractionIcon",keywords:["image","picture","photo"]},Me=[{title:"docQuickInsert.group.basics",id:"quick.insert.group.basic",children:[ue,de,pe,le,ve,he]}],be=new Set([de.id,pe.id,le.id,ve.id,he.id]);var ke=Object.getOwnPropertyDescriptor,xe=(r,n,e,t)=>{for(var i=t>1?void 0:t?ke(n,e):n,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},$=(r,n)=>(e,t)=>n(e,t,r);c.DocQuickInsertTriggerController=class extends s.Disposable{constructor(n,e,t,i,o){super(),this._commandService=n,this._textSelectionManagerService=e,this._docQuickInsertPopupService=t,this._shortcutService=i,this._univerInstanceService=o,this.disposeWithMe(this._shortcutService.registerShortcut({id:U.id,binding:p.KeyCode.ESC,preconditions:()=>!!this._docQuickInsertPopupService.editPopup,priority:1e3})),this._initTrigger(),this._initMenuHandler()}_initTrigger(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{var u,v,I;const{_docQuickInsertPopupService:e,_textSelectionManagerService:t,_commandService:i}=this,o=this._univerInstanceService.getCurrentUnitOfType(s.UniverInstanceType.UNIVER_DOC);if(!(o!=null&&o.getDisabled())){if(n.id===_.InsertCommand.id){const a=n.params;if(e.editPopup){e.setInputOffset({start:e.inputOffset.start,end:a.range.endOffset+1});return}const d=t.getActiveTextRange();if(!d)return;const l=e.resolvePopup(a.body.dataStream);if(!l||!(l.preconditions?l.preconditions(a):!0))return;e.setInputOffset({start:d.startOffset-1,end:d.startOffset}),setTimeout(()=>{i.executeCommand(ie.id,{index:d.startOffset-1,unitId:a.unitId,popup:l})},100)}if(n.id===_.IMEInputCommand.id){const a=n.params;!e.isComposing&&a.isCompositionStart&&e.setIsComposing(!0),e.isComposing&&a.isCompositionEnd&&e.setIsComposing(!1)}if(n.id===E.RichTextEditingMutation.id){const a=n.params;if(a.isCompositionEnd){const d=(v=(u=a.textRanges)==null?void 0:u[0])==null?void 0:v.endOffset;d&&e.setInputOffset({start:e.inputOffset.start,end:d})}}if(n.id===_.DeleteCommand.id){const a=n.params;if(e.editPopup&&a.direction===s.DeleteDirection.LEFT){const d=(I=a.len)!=null?I:0;e.setInputOffset({start:e.inputOffset.start,end:a.range.endOffset-d})}}if(n.id===_.MoveCursorOperation.id){const a=n.params;(a.direction===s.Direction.LEFT||a.direction===s.Direction.RIGHT)&&e.editPopup&&i.executeCommand(U.id)}if(n.id===_.DeleteLeftCommand.id){const a=t.getActiveTextRange();if(!e.editPopup||!a)return;a.endOffset<=e.editPopup.anchor&&i.executeCommand(U.id)}}}))}_initMenuHandler(){this.disposeWithMe(this._docQuickInsertPopupService.onMenuSelected(n=>{n.id!==ue.id&&be.has(n.id)&&this._commandService.executeCommand(n.id)}))}},c.DocQuickInsertTriggerController=xe([$(0,s.ICommandService),$(1,s.Inject(E.DocSelectionManagerService)),$(2,s.Inject(c.DocQuickInsertPopupService)),$(3,s.Inject(p.IShortcutService)),$(4,s.Inject(s.IUniverInstanceService))],c.DocQuickInsertTriggerController);var D=function(){return D=Object.assign||function(r){for(var n,e=1,t=arguments.length;e<t;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},D.apply(this,arguments)},Re=function(r,n){var e={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&n.indexOf(t)<0&&(e[t]=r[t]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,t=Object.getOwnPropertySymbols(r);i<t.length;i++)n.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(r,t[i])&&(e[t[i]]=r[t[i]]);return e},B=f.forwardRef(function(r,n){var e=r.icon,t=r.id,i=r.className,o=r.extend,u=Re(r,["icon","id","className","extend"]),v="univerjs-icon univerjs-icon-".concat(t," ").concat(i||"").trim(),I=f.useRef("_".concat(Ue()));return fe(e,"".concat(t),{defIds:e.defIds,idSuffix:I.current},D({ref:n,className:v},u),o)});function fe(r,n,e,t,i){return f.createElement(r.tag,D(D({key:n},Qe(r,e,i)),t),(Ee(r,e).children||[]).map(function(o,u){return fe(o,"".concat(n,"-").concat(r.tag,"-").concat(u),e,void 0,i)}))}function Qe(r,n,e){var t=D({},r.attrs);e!=null&&e.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=e.colorChannel1),r.tag==="mask"&&t.id&&(t.id=t.id+n.idSuffix),Object.entries(t).forEach(function(o){var u=o[0],v=o[1];u==="mask"&&typeof v=="string"&&(t[u]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))});var i=n.defIds;return!i||i.length===0||(r.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+n.idSuffix),Object.entries(t).forEach(function(o){var u=o[0],v=o[1];typeof v=="string"&&(t[u]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))})),t}function Ee(r,n){var e,t=n.defIds;return!t||t.length===0?r:r.tag==="defs"&&(!((e=r.children)===null||e===void 0)&&e.length)?D(D({},r),{children:r.children.map(function(i){return typeof i.attrs.id=="string"&&t&&t.includes(i.attrs.id)?D(D({},i),{attrs:D(D({},i.attrs),{id:i.attrs.id+n.idSuffix})}):i})}):r}function Ue(){return Math.random().toString(36).substring(2,8)}B.displayName="UniverIcon";var je={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.01953 3.13985C1.01953 2.77258 1.31726 2.47485 1.68453 2.47485H2.73713C3.1044 2.47485 3.40213 2.77258 3.40213 3.13985C3.40213 3.50712 3.1044 3.80485 2.73713 3.80485H1.68453C1.31726 3.80485 1.01953 3.50712 1.01953 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.17734 3.13985C4.17734 2.77258 4.47507 2.47485 4.84234 2.47485H6.94754C7.31481 2.47485 7.61254 2.77258 7.61254 3.13985C7.61254 3.50712 7.31481 3.80485 6.94754 3.80485H4.84234C4.47507 3.80485 4.17734 3.50712 4.17734 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.38775 3.13985C8.38775 2.77258 8.68548 2.47485 9.05275 2.47485H11.158C11.5252 2.47485 11.823 2.77258 11.823 3.13985C11.823 3.50712 11.5252 3.80485 11.158 3.80485H9.05275C8.68548 3.80485 8.38775 3.50712 8.38775 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.5982 3.13985C12.5982 2.77258 12.8959 2.47485 13.2632 2.47485H14.3158C14.683 2.47485 14.9808 2.77258 14.9808 3.13985C14.9808 3.50712 14.683 3.80485 14.3158 3.80485H13.2632C12.8959 3.80485 12.5982 3.50712 12.5982 3.13985Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.01953 7.99972C1.01953 7.63245 1.31726 7.33472 1.68453 7.33472H14.3158C14.683 7.33472 14.9808 7.63245 14.9808 7.99972C14.9808 8.36699 14.683 8.66472 14.3158 8.66472H1.68453C1.31726 8.66472 1.01953 8.36699 1.01953 7.99972Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.68453 12.1951C1.31726 12.1951 1.01953 12.4928 1.01953 12.8601C1.01953 13.2273 1.31726 13.5251 1.68453 13.5251H2.73713C3.1044 13.5251 3.40213 13.2273 3.40213 12.8601C3.40213 12.4928 3.1044 12.1951 2.73713 12.1951H1.68453Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.84234 12.1951C4.47507 12.1951 4.17734 12.4928 4.17734 12.8601C4.17734 13.2273 4.47507 13.5251 4.84234 13.5251H6.94754C7.31481 13.5251 7.61254 13.2273 7.61254 12.8601C7.61254 12.4928 7.31481 12.1951 6.94754 12.1951H4.84234Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M9.05275 12.1951C8.68548 12.1951 8.38775 12.4928 8.38775 12.8601C8.38775 13.2273 8.68548 13.5251 9.05275 13.5251H11.158C11.5252 13.5251 11.823 13.2273 11.823 12.8601C11.823 12.4928 11.5252 12.1951 11.158 12.1951H9.05275Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M13.2632 12.1951C12.8959 12.1951 12.5982 12.4928 12.5982 12.8601C12.5982 13.2273 12.8959 13.5251 13.2632 13.5251H14.3158C14.683 13.5251 14.9808 13.2273 14.9808 12.8601C14.9808 12.4928 14.683 12.1951 14.3158 12.1951H13.2632Z"}}]},z=f.forwardRef(function(r,n){return f.createElement(B,Object.assign({},r,{id:"divider-icon",ref:n,icon:je}))});z.displayName="DividerIcon";var $e={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},ge=f.forwardRef(function(r,n){return f.createElement(B,Object.assign({},r,{id:"increase-icon",ref:n,icon:$e}))});ge.displayName="IncreaseIcon";var Te={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{fill:"currentColor",clipPath:"url(#text-icon_clip0_1293_26)"},children:[{tag:"path",attrs:{d:"M2.22891 2.07227C1.89754 2.07227 1.62891 2.34089 1.62891 2.67227C1.62891 3.00364 1.89754 3.27227 2.22891 3.27227H6.29541V14.0056C6.29541 14.337 6.56404 14.6056 6.89541 14.6056C7.22678 14.6056 7.49541 14.337 7.49541 14.0056V3.27227H11.5622C11.8936 3.27227 12.1622 3.00364 12.1622 2.67227C12.1622 2.34089 11.8936 2.07227 11.5622 2.07227H2.22891Z"}},{tag:"path",attrs:{d:"M10.2289 6.40552C9.89754 6.40552 9.62891 6.67415 9.62891 7.00552C9.62891 7.33689 9.89754 7.60552 10.2289 7.60552H12.2954V14.0055C12.2954 14.3369 12.564 14.6055 12.8954 14.6055C13.2268 14.6055 13.4954 14.3369 13.4954 14.0055V7.60552H15.5622C15.8936 7.60552 16.1622 7.33689 16.1622 7.00552C16.1622 6.67415 15.8936 6.40552 15.5622 6.40552H10.2289Z"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"text-icon_clip0_1293_26"},children:[{tag:"path",attrs:{fill:"white",d:"M0 0H16V16H0z",transform:"translate(.9)"}}]}]}],defIds:["text-icon_clip0_1293_26"]},J=f.forwardRef(function(r,n){return f.createElement(B,Object.assign({},r,{id:"text-icon",ref:n,icon:Te}))});J.displayName="TextIcon";const X=({className:r=""})=>{const n=p.useDependency(c.DocQuickInsertPopupService),e=p.useDependency(s.IUniverInstanceService),t=p.useDependency(V.IRenderManagerService),i=p.useObservable(f.useMemo(()=>e.getCurrentTypeOfUnit$(s.UniverInstanceType.UNIVER_DOC),[e])),o=i&&t.getRenderById(i.getUnitId()),u=o==null?void 0:o.with(A),v=p.useDependency(p.ILayoutService),I=p.useDependency(E.DocSelectionManagerService),a=p.useObservable(n.editPopup$),d=p.useEvent(l=>{var T;const h=u==null?void 0:u.popup;if(!h)return;const O=n.popups,w={keyword:"",menus$:C.combineLatest(O.map(M=>M.menus$)).pipe(C.map(M=>M.flat()))};I.replaceDocRanges([{startOffset:h.startIndex,endOffset:h.startIndex}]),n.setInputOffset({start:h.startIndex-1,end:h.startIndex-1}),n.showPopup({popup:w,index:h.startIndex-1,unitId:(T=i==null?void 0:i.getUnitId())!=null?T:""}),setTimeout(()=>{v.focus()})});return m.jsx("div",{className:b.clsx("univer-mr-1 univer-flex univer-cursor-pointer univer-items-center univer-gap-2.5 univer-rounded-full univer-p-1.5 univer-shadow-sm dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",b.borderClassName,{"univer-bg-gray-100 dark:!univer-bg-gray-700":a,"univer-bg-white dark:!univer-bg-gray-900":!a},r),role:"button",tabIndex:0,onClick:d,children:m.jsx(ge,{className:"univer-text-gray-800 dark:!univer-text-gray-200"})})};X.componentKey=ae;var Ne=Object.getOwnPropertyDescriptor,Ke=(r,n,e,t)=>{for(var i=t>1?void 0:t?Ne(n,e):n,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},Y=(r,n)=>(e,t)=>n(e,t,r);c.DocQuickInsertUIController=class extends s.Disposable{constructor(n,e,t){super(),this._commandService=n,this._docQuickInsertPopupService=e,this._componentManager=t,this._initCommands(),this._initComponents(),this._initMenus()}_initCommands(){[ne,ie,U].forEach(n=>{this.disposeWithMe(this._commandService.registerCommand(n))})}_initComponents(){[[q.componentKey,q],[H.componentKey,H],[L.componentKey,L],[z.displayName,z],[J.displayName,J],[X.componentKey,X]].forEach(([e,t])=>{e&&this.disposeWithMe(this._componentManager.register(e,t))}),[{keyword:"/",menus$:C.of(Me),preconditions:e=>{var t;return((t=e.range.startNodePosition)==null?void 0:t.glyph)===0}}].forEach(e=>{this.disposeWithMe(this._docQuickInsertPopupService.registerPopup(e))})}_initMenus(){}},c.DocQuickInsertUIController=Ke([Y(0,s.ICommandService),Y(1,s.Inject(c.DocQuickInsertPopupService)),Y(2,s.Inject(p.ComponentManager))],c.DocQuickInsertUIController);var He=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,qe=(r,n,e)=>n in r?He(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e,Ae=(r,n,e,t)=>{for(var i=t>1?void 0:t?Le(n,e):n,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},me=(r,n)=>(e,t)=>n(e,t,r),Ie=(r,n,e)=>qe(r,typeof n!="symbol"?n+"":n,e);const Be="DOC_QUICK_INSERT_UI_PLUGIN";c.UniverDocsQuickInsertUIPlugin=class extends s.Plugin{constructor(n,e){super(),this._injector=n,this._renderManagerSrv=e}onStarting(){[[c.DocQuickInsertUIController],[c.DocQuickInsertTriggerController],[c.DocQuickInsertPopupService]].forEach(e=>this._injector.add(e)),this._injector.get(c.DocQuickInsertUIController)}onRendered(){this._injector.get(c.DocQuickInsertTriggerController),this._injector.get(c.DocQuickInsertPopupService),[[A]].forEach(n=>{this._renderManagerSrv.registerRenderModule(s.UniverInstanceType.UNIVER_DOC,n)})}},Ie(c.UniverDocsQuickInsertUIPlugin,"type",s.UniverInstanceType.UNIVER_DOC),Ie(c.UniverDocsQuickInsertUIPlugin,"pluginName",Be),c.UniverDocsQuickInsertUIPlugin=Ae([s.DependentOn(ye.UniverDrawingUIPlugin,_e.UniverDrawingPlugin,te.UniverDocsDrawingUIPlugin,R.UniverDocsDrawingPlugin,p.UniverUIPlugin),me(0,s.Inject(s.Injector)),me(1,s.Inject(V.IRenderManagerService))],c.UniverDocsQuickInsertUIPlugin),c.KeywordInputPlaceholderComponentKey=re,c.QuickInsertPlaceholderComponentKey=se,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/docs-quick-insert-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
"rxjs": ">=7.0.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@univerjs/icons": "^0.
|
|
56
|
-
"@univerjs/core": "0.
|
|
57
|
-
"@univerjs/design": "0.
|
|
58
|
-
"@univerjs/docs": "0.
|
|
59
|
-
"@univerjs/docs-drawing": "0.
|
|
60
|
-
"@univerjs/docs-drawing-ui": "0.
|
|
61
|
-
"@univerjs/docs-ui": "0.
|
|
62
|
-
"@univerjs/drawing": "0.
|
|
63
|
-
"@univerjs/drawing-ui": "0.
|
|
64
|
-
"@univerjs/engine-render": "0.
|
|
65
|
-
"@univerjs/ui": "0.
|
|
55
|
+
"@univerjs/icons": "^0.4.4",
|
|
56
|
+
"@univerjs/core": "0.8.0-beta.1",
|
|
57
|
+
"@univerjs/design": "0.8.0-beta.1",
|
|
58
|
+
"@univerjs/docs": "0.8.0-beta.1",
|
|
59
|
+
"@univerjs/docs-drawing": "0.8.0-beta.1",
|
|
60
|
+
"@univerjs/docs-drawing-ui": "0.8.0-beta.1",
|
|
61
|
+
"@univerjs/docs-ui": "0.8.0-beta.1",
|
|
62
|
+
"@univerjs/drawing": "0.8.0-beta.1",
|
|
63
|
+
"@univerjs/drawing-ui": "0.8.0-beta.1",
|
|
64
|
+
"@univerjs/engine-render": "0.8.0-beta.1",
|
|
65
|
+
"@univerjs/ui": "0.8.0-beta.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"postcss": "^8.5.3",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"tailwindcss": "^3.4.17",
|
|
72
72
|
"typescript": "^5.8.3",
|
|
73
73
|
"vite": "^6.3.5",
|
|
74
|
-
"vitest": "^3.1.
|
|
75
|
-
"@univerjs-infra/shared": "0.
|
|
74
|
+
"vitest": "^3.1.4",
|
|
75
|
+
"@univerjs-infra/shared": "0.8.0-beta.1"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"test": "vitest run",
|