@univerjs/docs-quick-insert-ui 0.17.0 → 0.18.0

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.
Files changed (76) hide show
  1. package/lib/cjs/index.js +33 -1
  2. package/lib/cjs/locale/ca-ES.js +1 -1
  3. package/lib/cjs/locale/en-US.js +1 -1
  4. package/lib/cjs/locale/es-ES.js +1 -1
  5. package/lib/cjs/locale/fa-IR.js +1 -1
  6. package/lib/cjs/locale/fr-FR.js +1 -1
  7. package/lib/cjs/locale/ja-JP.js +1 -1
  8. package/lib/cjs/locale/ko-KR.js +1 -1
  9. package/lib/cjs/locale/ru-RU.js +1 -1
  10. package/lib/cjs/locale/sk-SK.js +1 -1
  11. package/lib/cjs/locale/vi-VN.js +1 -1
  12. package/lib/cjs/locale/zh-CN.js +1 -1
  13. package/lib/cjs/locale/zh-TW.js +1 -1
  14. package/lib/es/index.js +33 -928
  15. package/lib/es/locale/ca-ES.js +1 -20
  16. package/lib/es/locale/en-US.js +1 -20
  17. package/lib/es/locale/es-ES.js +1 -20
  18. package/lib/es/locale/fa-IR.js +1 -20
  19. package/lib/es/locale/fr-FR.js +1 -20
  20. package/lib/es/locale/ja-JP.js +1 -20
  21. package/lib/es/locale/ko-KR.js +1 -20
  22. package/lib/es/locale/ru-RU.js +1 -20
  23. package/lib/es/locale/sk-SK.js +1 -20
  24. package/lib/es/locale/vi-VN.js +1 -20
  25. package/lib/es/locale/zh-CN.js +1 -20
  26. package/lib/es/locale/zh-TW.js +1 -20
  27. package/lib/index.css +292 -1
  28. package/lib/index.js +33 -928
  29. package/lib/locale/ca-ES.js +1 -20
  30. package/lib/locale/en-US.js +1 -20
  31. package/lib/locale/es-ES.js +1 -20
  32. package/lib/locale/fa-IR.js +1 -20
  33. package/lib/locale/fr-FR.js +1 -20
  34. package/lib/locale/ja-JP.js +1 -20
  35. package/lib/locale/ko-KR.js +1 -20
  36. package/lib/locale/ru-RU.js +1 -20
  37. package/lib/locale/sk-SK.js +1 -20
  38. package/lib/locale/vi-VN.js +1 -20
  39. package/lib/locale/zh-CN.js +1 -20
  40. package/lib/locale/zh-TW.js +1 -20
  41. package/lib/types/commands/commands/doc-quick-insert.command.d.ts +16 -1
  42. package/lib/types/commands/operations/quick-insert-popup.operation.d.ts +17 -2
  43. package/lib/types/config/config.d.ts +16 -1
  44. package/lib/types/controllers/doc-quick-insert-trigger.controller.d.ts +15 -0
  45. package/lib/types/controllers/doc-quick-insert-ui.controller.d.ts +15 -0
  46. package/lib/types/locale/ca-ES.d.ts +16 -1
  47. package/lib/types/locale/es-ES.d.ts +16 -1
  48. package/lib/types/locale/fa-IR.d.ts +16 -1
  49. package/lib/types/locale/fr-FR.d.ts +16 -1
  50. package/lib/types/locale/ja-JP.d.ts +16 -1
  51. package/lib/types/locale/ko-KR.d.ts +16 -1
  52. package/lib/types/locale/ru-RU.d.ts +16 -1
  53. package/lib/types/locale/sk-SK.d.ts +16 -1
  54. package/lib/types/locale/vi-VN.d.ts +16 -1
  55. package/lib/types/locale/zh-CN.d.ts +16 -1
  56. package/lib/types/locale/zh-TW.d.ts +16 -1
  57. package/lib/types/menu/built-in-menus.d.ts +16 -1
  58. package/lib/types/menu/doc-quick-insert-menu.controller.d.ts +19 -3
  59. package/lib/types/plugin.d.ts +16 -1
  60. package/lib/types/services/doc-quick-insert-popup.service.d.ts +24 -3
  61. package/lib/types/views/KeywordInputPlaceholder.d.ts +14 -1
  62. package/lib/types/views/QuickInsertMenu.d.ts +30 -0
  63. package/lib/umd/index.js +33 -1
  64. package/lib/umd/locale/ca-ES.js +1 -1
  65. package/lib/umd/locale/en-US.js +1 -1
  66. package/lib/umd/locale/es-ES.js +1 -1
  67. package/lib/umd/locale/fa-IR.js +1 -1
  68. package/lib/umd/locale/fr-FR.js +1 -1
  69. package/lib/umd/locale/ja-JP.js +1 -1
  70. package/lib/umd/locale/ko-KR.js +1 -1
  71. package/lib/umd/locale/ru-RU.js +1 -1
  72. package/lib/umd/locale/sk-SK.js +1 -1
  73. package/lib/umd/locale/vi-VN.js +1 -1
  74. package/lib/umd/locale/zh-CN.js +1 -1
  75. package/lib/umd/locale/zh-TW.js +1 -1
  76. package/package.json +16 -15
@@ -1,5 +1,21 @@
1
- import { DocumentDataModel, INeedCheckDisposable, Nullable, Disposable } from '@univerjs/core';
2
- import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
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
+ import type { DocumentDataModel, INeedCheckDisposable, Nullable } from '@univerjs/core';
17
+ import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
18
+ import { Disposable } from '@univerjs/core';
3
19
  import { DocCanvasPopManagerService, DocEventManagerService } from '@univerjs/docs-ui';
4
20
  import { DocQuickInsertPopupService } from '../services/doc-quick-insert-popup.service';
5
21
  export declare class DocQuickInsertMenuController extends Disposable implements IRenderModule {
@@ -8,7 +24,7 @@ export declare class DocQuickInsertMenuController extends Disposable implements
8
24
  private _docQuickInsertPopupService;
9
25
  private _docCanvasPopManagerService;
10
26
  private _popup$;
11
- readonly popup$: import('rxjs').Observable<Nullable<{
27
+ readonly popup$: import("rxjs").Observable<Nullable<{
12
28
  startIndex: number;
13
29
  disposable: INeedCheckDisposable;
14
30
  }>>;
@@ -1,4 +1,19 @@
1
- import { IUniverDocsQuickInsertUIConfig } from './config/config';
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
+ import type { IUniverDocsQuickInsertUIConfig } from './config/config';
2
17
  import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
18
  import { IRenderManagerService } from '@univerjs/engine-render';
4
19
  export declare class UniverDocsQuickInsertUIPlugin extends Plugin {
@@ -1,7 +1,24 @@
1
- import { IDisposable, Nullable, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
- import { IInsertCommandParams, DocCanvasPopManagerService } from '@univerjs/docs-ui';
3
- import { Observable } from 'rxjs';
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
+ import type { IDisposable, Nullable } from '@univerjs/core';
17
+ import type { IInsertCommandParams } from '@univerjs/docs-ui';
18
+ import type { Observable } from 'rxjs';
19
+ import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
4
20
  import { DocSelectionManagerService } from '@univerjs/docs';
21
+ import { DocCanvasPopManagerService } from '@univerjs/docs-ui';
5
22
  import { IRenderManagerService } from '@univerjs/engine-render';
6
23
  export interface IDocPopupGroupItem {
7
24
  id: string;
@@ -68,6 +85,10 @@ export declare class DocQuickInsertPopupService extends Disposable {
68
85
  resolvePopup(keyword: string): IDocPopup | undefined;
69
86
  registerPopup(popup: IDocPopup): () => void;
70
87
  private _createInputPlaceholderRenderRoot;
88
+ private _getParagraphBound;
89
+ private _getKeywordPlaceholderAnchorRect;
90
+ private _getKeywordPlaceholderExtraProps;
91
+ private _mountInputPlaceholder;
71
92
  showPopup(options: {
72
93
  popup: IDocPopup;
73
94
  index: number;
@@ -13,8 +13,21 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import type { IPopup } from '@univerjs/ui';
16
17
  export declare const KeywordInputPlaceholderComponentKey = "docs.quick.insert.keyword-input-placeholder";
18
+ interface IKeywordInputPlaceholderExtraProps {
19
+ fontSize?: number;
20
+ fontString?: string;
21
+ fontFamily?: string;
22
+ fontStyle?: 'normal' | 'italic';
23
+ fontWeight?: 'normal' | 'bold';
24
+ ascent?: number;
25
+ contentHeight?: number;
26
+ }
17
27
  export declare const KeywordInputPlaceholder: {
18
- (): import("react/jsx-runtime").JSX.Element;
28
+ ({ popup }: {
29
+ popup: IPopup<IKeywordInputPlaceholderExtraProps>;
30
+ }): import("react/jsx-runtime").JSX.Element;
19
31
  componentKey: string;
20
32
  };
33
+ export {};
@@ -0,0 +1,30 @@
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
+ import type { ComponentManager } from '@univerjs/ui';
17
+ import type { MutableRefObject } from 'react';
18
+ import type { DocPopupMenu, IDocPopupMenuItem } from '../services/doc-quick-insert-popup.service';
19
+ interface IQuickInsertMenuProps {
20
+ menus: DocPopupMenu[];
21
+ focusedMenuIndex: number;
22
+ focusedMenuRef: MutableRefObject<IDocPopupMenuItem | null>;
23
+ menuNodeMapRef: MutableRefObject<Map<string, HTMLElement>>;
24
+ componentManager: ComponentManager;
25
+ onFocusedMenuIndexChange: (index: number) => void;
26
+ onSelect: (menu: IDocPopupMenuItem) => void;
27
+ }
28
+ export declare function getQuickInsertMenuLeafCount(menus: DocPopupMenu[]): number;
29
+ export declare function QuickInsertMenu(props: IQuickInsertMenuProps): import("react/jsx-runtime").JSX.Element;
30
+ export {};
package/lib/umd/index.js CHANGED
@@ -1 +1,33 @@
1
- (function(c,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/ui"),require("@univerjs/engine-render"),require("rxjs"),require("react/jsx-runtime"),require("@univerjs/design"),require("react"),require("@univerjs/docs-drawing-ui"),require("@univerjs/docs-drawing"),require("@univerjs/drawing"),require("@univerjs/drawing-ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs","@univerjs/docs-ui","@univerjs/ui","@univerjs/engine-render","rxjs","react/jsx-runtime","@univerjs/design","react","@univerjs/docs-drawing-ui","@univerjs/docs-drawing","@univerjs/drawing","@univerjs/drawing-ui"],s):(c=typeof globalThis<"u"?globalThis:c||self,s(c.UniverDocsQuickInsertUi={},c.UniverCore,c.UniverDocs,c.UniverDocsUi,c.UniverUi,c.UniverEngineRender,c.rxjs,c.React,c.UniverDesign,c.React,c.UniverDocsDrawingUi,c.UniverDocsDrawing,c.UniverDrawing,c.UniverDrawingUi))})(this,(function(c,s,D,_,p,Z,C,g,O,h,te,_e,Se,ye){"use strict";var We=Object.defineProperty;var Ze=(c,s,D)=>s in c?We(c,s,{enumerable:!0,configurable:!0,writable:!0,value:D}):c[s]=D;var P=(c,s,D)=>Ze(c,typeof s!="symbol"?s+"":s,D);const ne={id:"doc.command.delete-search-key",type:s.CommandType.COMMAND,handler:(r,t)=>{const e=r.get(s.ICommandService),{start:n,end:i}=t;return e.syncExecuteCommand(_.CutContentCommand.id,{segmentId:"",textRanges:[{startOffset:n,endOffset:n,collapsed:!0}],selections:[{startOffset:n,endOffset:i,collapsed:!1,direction:s.RANGE_DIRECTION.FORWARD}]})}},ie="docs.quick.insert.keyword-input-placeholder",N=()=>{const r=p.useDependency(s.LocaleService);return g.jsx("div",{className:"univer-translate-y-1.5 univer-text-sm univer-text-gray-500",children:r.t("docQuickInsert.keywordInputPlaceholder")})};N.componentKey=ie;const re="docs.quick.insert.placeholder",K=()=>{const r=p.useDependency(s.LocaleService);return g.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:g.jsx("span",{children:r.t("docQuickInsert.placeholder")})})};K.componentKey=re;function V(r,t){return r.map(e=>({...e})).filter(e=>{if("children"in e)return e.children=V(e.children,t),e.children.length>0;const n=e.keywords;return n?n.some(i=>i.includes(t)):e.title.toLowerCase().includes(t)})}function se(r,t){return r.map(e=>{const n={...e};return"children"in n&&(n.children=se(n.children,t)),n.title=t.t(n.title),"keywords"in n&&(n.keywords=n.keywords.concat(n.title).map(i=>i.toLowerCase())),n})}const Pe=[p.KeyCode.ARROW_UP,p.KeyCode.ARROW_DOWN,p.KeyCode.ENTER],H=()=>{const r=p.useDependency(s.LocaleService),t=p.useDependency(c.DocQuickInsertPopupService),e=p.useDependency(p.ComponentManager),n=p.useDependency(p.IShortcutService),i=p.useDependency(s.ICommandService),o=h.useMemo(()=>s.generateRandomId(),[]),[u,m]=h.useState(0),I=h.useRef(null),a=h.useRef(0);a.current=0;const d=p.useObservable(t.filterKeyword$,""),l=p.useObservable(t.editPopup$),v=p.useObservable(l==null?void 0:l.popup.menus$,[]),M=h.useMemo(()=>se(v,r),[v]),[k,E]=h.useState(()=>V(M,d.toLowerCase()));h.useEffect(()=>{const S=requestIdleCallback(()=>{E(V(M,d.toLowerCase()))});return()=>{cancelIdleCallback(S)}},[M,d]);const w=S=>{t.emitMenuSelected(S),i.executeCommand(Q.id)};h.useEffect(()=>{const S=new s.DisposableCollection;n.getAllShortcuts().filter(f=>f.binding&&Pe.includes(f.binding)).forEach(f=>{const x=f.preconditions;f.preconditions=()=>!1,S.add(s.toDisposable(()=>{f.preconditions=x}))});const b={id:`quick.insert.popup.enter.${o}`,type:s.CommandType.OPERATION,handler:()=>{const f=I.current;f&&w(f)}},j={id:`quick.insert.popup.move.cursor.up.${o}`,type:s.CommandType.OPERATION,handler:()=>{m(f=>{const x=f-1;return x>=0?x:a.current-1})}},$={id:`quick.insert.popup.move.cursor.down.${o}`,type:s.CommandType.OPERATION,handler:()=>{m(f=>{const x=f+1;return x<=a.current-1?x:0})}};return S.add(i.registerCommand(j)),S.add(i.registerCommand($)),S.add(i.registerCommand(b)),S.add(n.registerShortcut({priority:1e3,id:j.id,binding:p.KeyCode.ARROW_UP,preconditions:()=>!0,staticParameters:{direction:s.Direction.UP}})),S.add(n.registerShortcut({priority:1e3,id:$.id,binding:p.KeyCode.ARROW_DOWN,preconditions:()=>!0,staticParameters:{direction:s.Direction.DOWN}})),S.add(n.registerShortcut({priority:1e3,id:b.id,binding:p.KeyCode.ENTER,preconditions:()=>!0})),()=>{S.dispose()}},[]),h.useEffect(()=>{m(0)},[k]);const B=h.useRef(new Map);h.useEffect(()=>()=>{B.current.clear()},[]);function T(S){return S.map(y=>{const ee=y.icon,b=ee?e.get(ee):null;if("children"in y)return g.jsx(O.MenuItemGroup,{title:g.jsxs("div",{className:"univer-mb-2 univer-flex univer-items-center univer-text-xs univer-text-gray-400",children:[b&&g.jsx("span",{className:"univer-mr-2 univer-inline-flex univer-text-base",children:g.jsx(b,{})}),g.jsx("span",{children:y.title})]}),children:T(y.children)},y.id);const j=a.current,$=u===j;if($){I.current=y;const f=B.current.get(y.id);f==null||f.scrollIntoView({block:"nearest"})}return a.current++,g.jsx(O.MenuItem,{ref:f=>{f&&B.current.set(y.id,f)},onMouseEnter:()=>m(j),onMouseLeave:()=>m(Number.NaN),className:O.clsx("univer-w-[calc(220px-var(--padding-base)*2)] univer-text-sm",{"hover:univer-bg-transparent":!$,"univer-bg-gray-100 dark:!univer-bg-gray-500":$}),onClick:()=>{w(y)},children:g.jsxs("div",{className:"univer-flex univer-w-full univer-items-center univer-px-1",children:[b&&g.jsx("span",{className:"univer-mr-2 univer-inline-flex univer-text-base",children:g.jsx(b,{})}),g.jsx(O.Tooltip,{showIfEllipsis:!0,title:y.title,placement:"right",children:g.jsx("span",{className:"univer-truncate",children:y.title})})]})},y.id)})}const W=k.length>0,Ce=(l==null?void 0:l.popup.Placeholder)||e.get(K.componentKey);return g.jsx("div",{className:"univer-mt-2",children:W?g.jsx(O.Menu,{wrapperClass:O.clsx("univer-max-h-[360px] univer-w-[220px] univer-overflow-y-auto univer-overflow-x-hidden",O.scrollbarClassName),children:T(k)}):Ce&&g.jsx(Ce,{})})};H.componentKey="docs.quick.insert.popup";var De=Object.getOwnPropertyDescriptor,Me=(r,t,e,n)=>{for(var i=n>1?void 0:n?De(t,e):t,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},R=(r,t)=>(e,n)=>t(e,n,r);const oe={dispose:()=>{}};c.DocQuickInsertPopupService=class extends s.Disposable{constructor(e,n,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=n,this._commandService=i,this._renderManagerService=o,this._docSelectionManagerService=u,this.disposeWithMe(this._editPopup$);const m=(a,d)=>{var l,v;return(v=(l=this._univerInstanceService.getCurrentUnitOfType(s.UniverInstanceType.UNIVER_DOC))==null?void 0:l.getBody())==null?void 0:v.dataStream.slice(a,d)};let I="";this.filterKeyword$=this._inputOffset$.pipe(C.map(a=>{var l;const d=m(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,v;a.length>0?(l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose():(v=this._inputPlaceholderRenderRoot)==null||v.mount()})),this.isComposing$.pipe(C.tap(a=>{var d,l,v;a?(l=(d=this._inputPlaceholderRenderRoot)==null?void 0:d.unmount)==null||l.dispose():I.length<=0&&((v=this._inputPlaceholderRenderRoot)==null||v.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 n;return(n=this._renderManagerService.getRenderById(e))==null?void 0:n.with(_.DocEventManagerService)}resolvePopup(e){return Array.from(this._popups).find(n=>n.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,v;const{popup:n,index:i,unitId:o}=e;this.closePopup();const u=this._univerInstanceService.getUnit(o),m=(v=(l=u==null?void 0:u.getBody())==null?void 0:l.paragraphs)==null?void 0:v.find(M=>M.startIndex>i);if(!m)return;const I=this.getDocEventManagerService(o),a=I==null?void 0:I.findParagraphBoundByIndex(m.startIndex);if(!a)return;this._inputPlaceholderRenderRoot=this._createInputPlaceholderRenderRoot(()=>{var W;const M=(W=this._renderManagerService.getRenderById(o))==null?void 0:W.with(D.DocSkeletonManagerService),k=this._docSelectionManagerService.getActiveTextRange();if(!M||!k)return oe;const w=M.getSkeleton().findNodeByCharIndex(k.startOffset,k.segmentId,k.segmentPage);if(!((w==null?void 0:w.content)==="\r"))return oe;const T=this._docCanvasPopupManagerService.attachPopupToRange({startOffset:i+1,endOffset:i+1,collapsed:!1},{componentKey:N.componentKey,onClickOutside:()=>{T.dispose()},direction:"horizontal"},o);return T}),this._inputPlaceholderRenderRoot.mount();const d=this._docCanvasPopupManagerService.attachPopupToRect(a.firstLine,{componentKey:H.componentKey,onClickOutside:()=>{this.closePopup()},direction:"bottom"},o);this._editPopup$.next({disposable:d,popup:n,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:n,end:i}=this.inputOffset;this._commandService.syncExecuteCommand(ne.id,{start:n,end:i}),setTimeout(()=>{this._menuSelectedCallbacks.forEach(o=>o(e))},0)}},c.DocQuickInsertPopupService=Me([R(0,s.Inject(_.DocCanvasPopManagerService)),R(1,s.Inject(s.IUniverInstanceService)),R(2,s.Inject(s.ICommandService)),R(3,s.Inject(Z.IRenderManagerService)),R(4,s.Inject(D.DocSelectionManagerService))],c.DocQuickInsertPopupService);const ce={type:s.CommandType.OPERATION,id:"doc.operation.show-quick-insert-popup",handler(r,t){const e=r.get(c.DocQuickInsertPopupService);return t?(e.showPopup(t),!0):!1}},Q={type:s.CommandType.OPERATION,id:"doc.operation.close-quick-insert-popup",handler(r){return r.get(c.DocQuickInsertPopupService).closePopup(),!0}},ae={id:"quick-insert.text.menu",title:"docQuickInsert.menu.text",icon:"TextIcon",keywords:["text"]},ue={id:_.OrderListCommand.id,title:"docQuickInsert.menu.numberedList",icon:"OrderIcon",keywords:["numbered","list","ordered"]},de={id:_.BulletListCommand.id,title:"docQuickInsert.menu.bulletedList",icon:"UnorderIcon",keywords:["bulleted","list","unordered"]},pe={id:_.HorizontalLineCommand.id,title:"docQuickInsert.menu.divider",icon:"DividerIcon",keywords:["divider","line","separate"]},le={id:_.DocCreateTableOperation.id,title:"docQuickInsert.menu.table",icon:"GridIcon",keywords:["table","grid","spreadsheet"]},ve={id:te.InsertDocImageCommand.id,title:"docQuickInsert.menu.image",icon:"AdditionAndSubtractionIcon",keywords:["image","picture","photo"]},ke=[{title:"docQuickInsert.group.basics",id:"quick.insert.group.basic",children:[ae,ue,de,pe,le,ve]}],we=new Set([ue.id,de.id,pe.id,le.id,ve.id]);var Oe=Object.getOwnPropertyDescriptor,be=(r,t,e,n)=>{for(var i=n>1?void 0:n?Oe(t,e):t,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},U=(r,t)=>(e,n)=>t(e,n,r);c.DocQuickInsertTriggerController=class extends s.Disposable{constructor(t,e,n,i,o){super(),this._commandService=t,this._textSelectionManagerService=e,this._docQuickInsertPopupService=n,this._shortcutService=i,this._univerInstanceService=o,this.disposeWithMe(this._shortcutService.registerShortcut({id:Q.id,binding:p.KeyCode.ESC,preconditions:()=>!!this._docQuickInsertPopupService.editPopup,priority:1e3})),this._initTrigger(),this._initMenuHandler()}_initTrigger(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var u,m,I;const{_docQuickInsertPopupService:e,_textSelectionManagerService:n,_commandService:i}=this,o=this._univerInstanceService.getCurrentUnitOfType(s.UniverInstanceType.UNIVER_DOC);if(!(o!=null&&o.getDisabled())){if(t.id===_.InsertCommand.id){const a=t.params;if(e.editPopup){e.setInputOffset({start:e.inputOffset.start,end:a.range.endOffset+1});return}const d=n.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(ce.id,{index:d.startOffset-1,unitId:a.unitId,popup:l})},100)}if(t.id===_.IMEInputCommand.id){const a=t.params;!e.isComposing&&a.isCompositionStart&&e.setIsComposing(!0),e.isComposing&&a.isCompositionEnd&&e.setIsComposing(!1)}if(t.id===D.RichTextEditingMutation.id){const a=t.params;if(a.isCompositionEnd){const d=(m=(u=a.textRanges)==null?void 0:u[0])==null?void 0:m.endOffset;d&&e.setInputOffset({start:e.inputOffset.start,end:d})}}if(t.id===_.DeleteCommand.id){const a=t.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(t.id===_.MoveCursorOperation.id){const a=t.params;(a.direction===s.Direction.LEFT||a.direction===s.Direction.RIGHT)&&e.editPopup&&i.executeCommand(Q.id)}if(t.id===_.DeleteLeftCommand.id){const a=n.getActiveTextRange();if(!e.editPopup||!a)return;a.endOffset<=e.editPopup.anchor&&i.executeCommand(Q.id)}}}))}_initMenuHandler(){this.disposeWithMe(this._docQuickInsertPopupService.onMenuSelected(t=>{t.id!==ae.id&&we.has(t.id)&&this._commandService.executeCommand(t.id)}))}},c.DocQuickInsertTriggerController=be([U(0,s.ICommandService),U(1,s.Inject(D.DocSelectionManagerService)),U(2,s.Inject(c.DocQuickInsertPopupService)),U(3,s.Inject(p.IShortcutService)),U(4,s.Inject(s.IUniverInstanceService))],c.DocQuickInsertTriggerController);function L({ref:r,...t}){const{icon:e,id:n,className:i,extend:o,...u}=t,m=`univerjs-icon univerjs-icon-${n} ${i||""}`.trim(),I=h.useRef(`_${Re()}`);return he(e,`${n}`,{defIds:e.defIds,idSuffix:I.current},{ref:r,className:m,...u},o)}function he(r,t,e,n,i){return h.createElement(r.tag,{key:t,...xe(r,e,i),...n},($e(r,e).children||[]).map((o,u)=>he(o,`${t}-${r.tag}-${u}`,e,void 0,i)))}function xe(r,t,e){const n={...r.attrs};e!=null&&e.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=e.colorChannel1),r.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(([o,u])=>{o==="mask"&&typeof u=="string"&&(n[o]=u.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});const{defIds:i}=t;return!i||i.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(([o,u])=>{typeof u=="string"&&(n[o]=u.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))})),n}function $e(r,t){var n;const{defIds:e}=t;return!e||e.length===0?r:r.tag==="defs"&&((n=r.children)!=null&&n.length)?{...r,children:r.children.map(i=>typeof i.attrs.id=="string"&&e&&e.includes(i.attrs.id)?{...i,attrs:{...i.attrs,id:i.attrs.id+t.idSuffix}}:i)}:r}function Re(){return Math.random().toString(36).substring(2,8)}L.displayName="UniverIcon";const Qe={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"}}]},F=h.forwardRef(function(t,e){return h.createElement(L,Object.assign({},t,{id:"divider-icon",ref:e,icon:Qe}))});F.displayName="DividerIcon";const Ue={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"}}]},fe=h.forwardRef(function(t,e){return h.createElement(L,Object.assign({},t,{id:"increase-icon",ref:e,icon:Ue}))});fe.displayName="IncreaseIcon";const Ee={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"]},G=h.forwardRef(function(t,e){return h.createElement(L,Object.assign({},t,{id:"text-icon",ref:e,icon:Ee}))});G.displayName="TextIcon";const ge="doc.quick-insert.button";var Te=Object.getOwnPropertyDescriptor,je=(r,t,e,n)=>{for(var i=n>1?void 0:n?Te(t,e):t,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},z=(r,t)=>(e,n)=>t(e,n,r);let q=class extends s.Disposable{constructor(t,e,n,i){super();P(this,"_popup$",new C.BehaviorSubject(null));P(this,"popup$",this._popup$.asObservable());this._context=t,this._docEventManagerService=e,this._docQuickInsertPopupService=n,this._docCanvasPopManagerService=i,this._init()}get popup(){return this._popup$.value}_init(){this.disposeWithMe(C.combineLatest([this._docEventManagerService.hoverParagraphLeftRealTime$,this._docEventManagerService.hoverParagraphRealTime$]).subscribe(([t,e])=>{var o;const n=t!=null?t:e,i=this._context.unit.getDisabled();if(!n||i){this._hideMenu(!0);return}if(n.paragraphStart===n.paragraphEnd){if(this._docQuickInsertPopupService.editPopup||n.startIndex===((o=this.popup)==null?void 0:o.startIndex))return;this._hideMenu(!0);const u=this._docCanvasPopManagerService.attachPopupToRect(n.firstLine,{componentKey:ge,direction:"left-center"},this._context.unit.getUnitId());this._popup$.next({startIndex:n.startIndex,disposable:u})}else this._hideMenu(!0)}))}_hideMenu(t){this._docQuickInsertPopupService.editPopup||this.popup&&(t||this.popup.disposable.canDispose())&&(this.popup.disposable.dispose(),this._popup$.next(null))}};q=je([z(1,s.Inject(_.DocEventManagerService)),z(2,s.Inject(c.DocQuickInsertPopupService)),z(3,s.Inject(_.DocCanvasPopManagerService))],q);const Y=({className:r=""})=>{const t=p.useDependency(c.DocQuickInsertPopupService),e=p.useDependency(s.IUniverInstanceService),n=p.useDependency(Z.IRenderManagerService),i=p.useObservable(h.useMemo(()=>e.getCurrentTypeOfUnit$(s.UniverInstanceType.UNIVER_DOC),[e])),o=i&&n.getRenderById(i.getUnitId()),u=o==null?void 0:o.with(q),m=p.useDependency(p.ILayoutService),I=p.useDependency(D.DocSelectionManagerService),a=p.useObservable(t.editPopup$),d=p.useEvent(l=>{var E;const v=u==null?void 0:u.popup;if(!v)return;const M=t.popups,k={keyword:"",menus$:C.combineLatest(M.map(w=>w.menus$)).pipe(C.map(w=>w.flat()))};I.replaceDocRanges([{startOffset:v.startIndex,endOffset:v.startIndex}]),t.setInputOffset({start:v.startIndex-1,end:v.startIndex-1}),t.showPopup({popup:k,index:v.startIndex-1,unitId:(E=i==null?void 0:i.getUnitId())!=null?E:""}),setTimeout(()=>{m.focus()})});return g.jsx("div",{className:O.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 dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-700",O.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:g.jsx(fe,{className:"univer-text-gray-800 dark:!univer-text-gray-200"})})};Y.componentKey=ge;var Ne=Object.getOwnPropertyDescriptor,Ke=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ne(t,e):t,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},J=(r,t)=>(e,n)=>t(e,n,r);c.DocQuickInsertUIController=class extends s.Disposable{constructor(t,e,n){super(),this._commandService=t,this._docQuickInsertPopupService=e,this._componentManager=n,this._initCommands(),this._initComponents(),this._initMenus()}_initCommands(){[ne,ce,Q].forEach(t=>{this.disposeWithMe(this._commandService.registerCommand(t))})}_initComponents(){[[H.componentKey,H],[N.componentKey,N],[K.componentKey,K],[F.displayName,F],[G.displayName,G],[Y.componentKey,Y]].forEach(([e,n])=>{e&&this.disposeWithMe(this._componentManager.register(e,n))}),[{keyword:"/",menus$:C.of(ke),preconditions:e=>{var n;return((n=e.range.startNodePosition)==null?void 0:n.glyph)===0}}].forEach(e=>{this.disposeWithMe(this._docQuickInsertPopupService.registerPopup(e))})}_initMenus(){}},c.DocQuickInsertUIController=Ke([J(0,s.ICommandService),J(1,s.Inject(c.DocQuickInsertPopupService)),J(2,s.Inject(p.ComponentManager))],c.DocQuickInsertUIController);const me={name:"@univerjs/docs-quick-insert-ui",version:"0.17.0"},He="docs-quick-insert-ui.config",Ie={};var Le=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,Ae=(r,t,e)=>t in r?Le(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Be=(r,t,e,n)=>{for(var i=n>1?void 0:n?qe(t,e):t,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},X=(r,t)=>(e,n)=>t(e,n,r),A=(r,t,e)=>Ae(r,typeof t!="symbol"?t+"":t,e);c.UniverDocsQuickInsertUIPlugin=class extends s.Plugin{constructor(t=Ie,e,n,i){super(),this._config=t,this._injector=e,this._renderManagerSrv=n,this._configService=i;const{menu:o,...u}=s.merge({},Ie,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(He,u)}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),[[q]].forEach(t=>{this._renderManagerSrv.registerRenderModule(s.UniverInstanceType.UNIVER_DOC,t)})}},A(c.UniverDocsQuickInsertUIPlugin,"type",s.UniverInstanceType.UNIVER_DOC),A(c.UniverDocsQuickInsertUIPlugin,"pluginName","DOC_QUICK_INSERT_UI_PLUGIN"),A(c.UniverDocsQuickInsertUIPlugin,"packageName",me.name),A(c.UniverDocsQuickInsertUIPlugin,"version",me.version),c.UniverDocsQuickInsertUIPlugin=Be([s.DependentOn(ye.UniverDrawingUIPlugin,Se.UniverDrawingPlugin,te.UniverDocsDrawingUIPlugin,_e.UniverDocsDrawingPlugin,p.UniverUIPlugin),X(1,s.Inject(s.Injector)),X(2,s.Inject(Z.IRenderManagerService)),X(3,s.IConfigService)],c.UniverDocsQuickInsertUIPlugin),c.KeywordInputPlaceholderComponentKey=ie,c.QuickInsertPlaceholderComponentKey=re,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/docs`),require(`@univerjs/docs-ui`),require(`@univerjs/ui`),require(`@univerjs/engine-render`),require(`rxjs`),require(`react`),require(`react/jsx-runtime`),require(`@univerjs/design`),require(`@univerjs/docs-drawing-ui`),require(`@univerjs/docs-drawing`),require(`@univerjs/drawing`),require(`@univerjs/drawing-ui`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/docs`,`@univerjs/docs-ui`,`@univerjs/ui`,`@univerjs/engine-render`,`rxjs`,`react`,`react/jsx-runtime`,`@univerjs/design`,`@univerjs/docs-drawing-ui`,`@univerjs/docs-drawing`,`@univerjs/drawing`,`@univerjs/drawing-ui`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverDocsQuickInsertUi={},e.UniverCore,e.UniverDocs,e.UniverDocsUi,e.UniverUi,e.UniverEngineRender,e.rxjs,e.React,e.React,e.UniverDesign,e.UniverDocsDrawingUi,e.UniverDocsDrawing,e.UniverDrawing,e.UniverDrawingUi))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let m={id:`doc.command.delete-search-key`,type:t.CommandType.COMMAND,handler:(e,n)=>{let i=e.get(t.ICommandService),{start:a,end:o}=n;return i.syncExecuteCommand(r.CutContentCommand.id,{segmentId:``,textRanges:[{startOffset:a,endOffset:a,collapsed:!0}],selections:[{startOffset:a,endOffset:o,collapsed:!1,direction:t.RANGE_DIRECTION.FORWARD}]})}},h=`docs.quick.insert.keyword-input-placeholder`;function g(e,t){if(typeof document>`u`)return e.length*11;let n=document.createElement(`canvas`).getContext(`2d`);return n?(n.font=t,Math.ceil(n.measureText(e).width)):e.length*11}let _=({popup:e})=>{var n,r,o,l,u,d,f,p,m,h,_;let v=(0,i.useDependency)(t.LocaleService).t(`docQuickInsert.keywordInputPlaceholder`),y=(0,a.ptToPixel)((n=(r=e.extraProps)==null?void 0:r.fontSize)==null?11:n),b=(o=(l=e.extraProps)==null?void 0:l.fontString)==null?`${y}px sans-serif`:o,x=(u=(d=e.extraProps)==null?void 0:d.ascent)==null?y:u,S=Math.max((f=(p=e.extraProps)==null?void 0:p.contentHeight)==null?y:f,y),C=(0,s.useMemo)(()=>g(v,b),[b,v]);return(0,c.jsx)(`div`,{className:`
2
+ univer-select-none univer-font-normal univer-text-gray-500 univer-transition-colors
3
+ dark:!univer-text-gray-400
4
+ `,children:(0,c.jsx)(`svg`,{width:C,height:S,viewBox:`0 0 ${C} ${S}`,style:{overflow:`visible`,display:`block`},children:(0,c.jsx)(`text`,{x:0,y:x,fill:`currentColor`,style:{font:b,fontFamily:(m=e.extraProps)==null?void 0:m.fontFamily,fontStyle:(h=e.extraProps)==null?void 0:h.fontStyle,fontWeight:(_=e.extraProps)==null?void 0:_.fontWeight},children:v})})})};_.componentKey=h;function v(e){return`children`in e}function y(e){return e.flatMap(e=>v(e)?y(e.children):e)}function b(e){return y(e).length}function x(e){let{menus:t,focusedMenuIndex:n,focusedMenuRef:r,menuNodeMapRef:i,componentManager:a,onFocusedMenuIndexChange:o,onSelect:u}=e,d=(0,s.useMemo)(()=>y(t),[t]);(0,s.useEffect)(()=>{var e,t;let a=Number.isNaN(n)||(e=d[n])==null?null:e;r.current=a,a&&((t=i.current.get(a.id))==null||t.scrollIntoView({block:`nearest`}))},[d,n,r,i]);let f=(0,s.useRef)(0);f.current=0;function p(e){return e.map((t,r)=>{let s=t.icon,d=s?a.get(s):null;if(v(t))return(0,c.jsxs)(`div`,{className:(0,l.clsx)(`univer-grid univer-gap-1 univer-py-1`,r!==e.length-1&&l.borderBottomClassName),children:[(0,c.jsxs)(`div`,{className:`
5
+ univer-box-border univer-inline-flex univer-items-center univer-gap-2 univer-px-2
6
+ univer-text-xs univer-font-semibold univer-text-gray-600
7
+ dark:!univer-text-gray-300
8
+ `,children:[d&&(0,c.jsx)(`span`,{className:`univer-inline-flex univer-text-base`,children:(0,c.jsx)(d,{})}),(0,c.jsx)(`span`,{children:t.title})]}),(0,c.jsx)(`div`,{className:`univer-grid univer-gap-1`,children:p(t.children)})]},t.id);let m=f.current,h=n===m;return f.current+=1,(0,c.jsx)(`div`,{ref:e=>{if(e){i.current.set(t.id,e);return}i.current.delete(t.id)},role:`button`,tabIndex:-1,className:(0,l.clsx)(`
9
+ univer-relative univer-box-border univer-flex univer-min-h-8 univer-w-full univer-cursor-pointer
10
+ univer-items-center univer-justify-between univer-gap-3 univer-rounded-md univer-border-none
11
+ univer-bg-transparent univer-px-2 univer-text-left univer-text-sm univer-text-gray-900
12
+ univer-outline-none
13
+ hover:univer-bg-gray-50
14
+ dark:!univer-text-white
15
+ dark:hover:!univer-bg-gray-600
16
+ `,{"hover:univer-bg-transparent":!h,"univer-bg-gray-50 dark:!univer-bg-gray-600":h}),onMouseEnter:()=>o(m),onMouseLeave:()=>o(NaN),onClick:()=>u(t),children:(0,c.jsxs)(`div`,{className:`univer-inline-flex univer-w-full univer-items-center univer-gap-2`,children:[d&&(0,c.jsx)(`span`,{className:`univer-inline-flex univer-text-base`,children:(0,c.jsx)(d,{})}),(0,c.jsx)(l.Tooltip,{showIfEllipsis:!0,title:t.title,placement:`right`,children:(0,c.jsx)(`span`,{className:`univer-truncate`,children:t.title})})]})},t.id)})}return(0,c.jsx)(`div`,{className:(0,l.clsx)(`
17
+ univer-box-border univer-grid univer-max-h-[360px] univer-gap-1 univer-overflow-y-auto
18
+ univer-overflow-x-hidden univer-overscroll-contain univer-rounded-md univer-bg-white univer-px-2
19
+ univer-py-1 univer-text-sm univer-text-gray-900 univer-shadow-md
20
+ dark:!univer-bg-gray-700 dark:!univer-text-white
21
+ `,l.borderClassName,l.scrollbarClassName),onWheel:e=>e.stopPropagation(),children:p(t)})}let S=`docs.quick.insert.placeholder`,C=()=>(0,c.jsx)(`div`,{className:`
22
+ univer-flex univer-h-full univer-items-center univer-justify-center univer-rounded-lg univer-bg-white
23
+ univer-px-12 univer-py-6 univer-text-gray-400 univer-shadow-lg
24
+ `,children:(0,c.jsx)(`span`,{children:(0,i.useDependency)(t.LocaleService).t(`docQuickInsert.placeholder`)})});C.componentKey=S;function w(e,t){return e.map(e=>({...e})).filter(e=>{if(`children`in e)return e.children=w(e.children,t),e.children.length>0;let n=e.keywords;return n?n.some(e=>e.includes(t)):e.title.toLowerCase().includes(t)})}function T(e,t){return e.map(e=>{let n={...e};return`children`in n&&(n.children=T(n.children,t)),n.title=t.t(n.title),`keywords`in n&&(n.keywords=n.keywords.concat(n.title).map(e=>e.toLowerCase())),n})}let ee=[i.KeyCode.ARROW_UP,i.KeyCode.ARROW_DOWN,i.KeyCode.ENTER],E=()=>{let e=(0,i.useDependency)(t.LocaleService),n=(0,i.useDependency)(P),r=(0,i.useDependency)(i.ComponentManager),a=(0,i.useDependency)(i.IShortcutService),o=(0,i.useDependency)(t.ICommandService),l=(0,s.useMemo)(()=>(0,t.generateRandomId)(),[]),[u,d]=(0,s.useState)(0),f=(0,s.useRef)(null),p=(0,i.useObservable)(n.filterKeyword$,``),m=(0,i.useObservable)(n.editPopup$),h=(0,i.useObservable)(m==null?void 0:m.popup.menus$,[]),g=(0,s.useMemo)(()=>T(h,e),[h]),[_,v]=(0,s.useState)(()=>w(g,p.toLowerCase())),y=(0,s.useMemo)(()=>b(_),[_]),S=(0,s.useRef)(y);(0,s.useEffect)(()=>{S.current=y},[y]),(0,s.useEffect)(()=>{let e=requestIdleCallback(()=>{v(w(g,p.toLowerCase()))});return()=>{cancelIdleCallback(e)}},[g,p]);let E=e=>{n.emitMenuSelected(e),o.executeCommand(I.id)};(0,s.useEffect)(()=>{let e=new t.DisposableCollection;a.getAllShortcuts().filter(e=>e.binding&&ee.includes(e.binding)).forEach(n=>{let r=n.preconditions;n.preconditions=()=>!1,e.add((0,t.toDisposable)(()=>{n.preconditions=r}))});let n={id:`quick.insert.popup.enter.${l}`,type:t.CommandType.OPERATION,handler:()=>{let e=f.current;e&&E(e)}},r={id:`quick.insert.popup.move.cursor.up.${l}`,type:t.CommandType.OPERATION,handler:()=>{d(e=>{if(S.current<=0)return 0;let t=e-1;return t>=0?t:S.current-1})}},s={id:`quick.insert.popup.move.cursor.down.${l}`,type:t.CommandType.OPERATION,handler:()=>{d(e=>{if(S.current<=0)return 0;let t=e+1;return t<=S.current-1?t:0})}};return e.add(o.registerCommand(r)),e.add(o.registerCommand(s)),e.add(o.registerCommand(n)),e.add(a.registerShortcut({priority:1e3,id:r.id,binding:i.KeyCode.ARROW_UP,preconditions:()=>!0,staticParameters:{direction:t.Direction.UP}})),e.add(a.registerShortcut({priority:1e3,id:s.id,binding:i.KeyCode.ARROW_DOWN,preconditions:()=>!0,staticParameters:{direction:t.Direction.DOWN}})),e.add(a.registerShortcut({priority:1e3,id:n.id,binding:i.KeyCode.ENTER,preconditions:()=>!0})),()=>{e.dispose()}},[o,l,a]),(0,s.useEffect)(()=>{d(0)},[_]);let D=(0,s.useRef)(new Map);(0,s.useEffect)(()=>()=>{D.current.clear()},[]);let O=_.length>0,k=(m==null?void 0:m.popup.Placeholder)||r.get(C.componentKey);return(0,c.jsx)(`div`,{className:`univer-mt-2`,children:O?(0,c.jsx)(x,{menus:_,focusedMenuIndex:u,focusedMenuRef:f,menuNodeMapRef:D,componentManager:r,onFocusedMenuIndexChange:d,onSelect:E}):k&&(0,c.jsx)(k,{})})};E.componentKey=`docs.quick.insert.popup`;function D(e){"@babel/helpers - typeof";return D=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},D(e)}function O(e,t){if(D(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(D(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function k(e){var t=O(e,`string`);return D(t)==`symbol`?t:t+``}function A(e,t,n){return(t=k(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e,t){return function(n,r){t(n,r,e)}}function M(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let N={dispose:()=>{}},P=class extends t.Disposable{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(r.DocEventManagerService)}constructor(e,n,r,i,a){super(),this._docCanvasPopupManagerService=e,this._univerInstanceService=n,this._commandService=r,this._renderManagerService=i,this._docSelectionManagerService=a,A(this,`_popups`,new Set),A(this,`_editPopup$`,new o.BehaviorSubject(void 0)),A(this,`editPopup$`,this._editPopup$.asObservable()),A(this,`_isComposing$`,new o.BehaviorSubject(!1)),A(this,`isComposing$`,this._isComposing$.asObservable()),A(this,`_inputOffset$`,new o.BehaviorSubject({start:0,end:0})),A(this,`inputOffset$`,this._inputOffset$.asObservable()),A(this,`filterKeyword$`,void 0),A(this,`_menuSelectedCallbacks`,new Set),A(this,`_inputPlaceholderRenderRoot`,null),this.disposeWithMe(this._editPopup$);let s=(e,n)=>{var r;return(r=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC))==null||(r=r.getBody())==null?void 0:r.dataStream.slice(e,n)},c=``;this.filterKeyword$=this._inputOffset$.pipe((0,o.map)(e=>{var t;let n=s(e.start,e.end);return(t=n==null?void 0:n.slice(1))==null?``:t}),(0,o.distinctUntilChanged)(),(0,o.tap)(e=>{c=e})),this.disposeWithMe((0,o.combineLatest)([this.filterKeyword$.pipe((0,o.tap)(e=>{if(e.length>0){var t;(t=this._inputPlaceholderRenderRoot)==null||(t=t.unmount)==null||t.dispose()}else{var n;(n=this._inputPlaceholderRenderRoot)==null||n.mount()}})),this.isComposing$.pipe((0,o.tap)(e=>{if(e){var t;(t=this._inputPlaceholderRenderRoot)==null||(t=t.unmount)==null||t.dispose()}else{var n;c.length<=0&&((n=this._inputPlaceholderRenderRoot)==null||n.mount())}})),this.editPopup$.pipe((0,o.tap)(e=>{if(!e){var t;(t=this._inputPlaceholderRenderRoot)==null||(t=t.unmount)==null||t.dispose(),this._inputPlaceholderRenderRoot=null}}))]).subscribe())}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;let t=e();this.unmount={dispose:()=>{t.dispose(),this.isMounted=!1}}}}}_getParagraphBound(e,t){var n,r;let i=this._univerInstanceService.getUnit(e),a=i==null||(n=i.getBody())==null||(n=n.paragraphs)==null?void 0:n.find(e=>e.startIndex>t);if(!a)return null;let o=this.getDocEventManagerService(e);return(r=o==null?void 0:o.findParagraphBoundByIndex(a.startIndex))==null?null:r}_getKeywordPlaceholderAnchorRect(e,t,n,i){let a=t.findNodePositionByCharIndex(n.startOffset,!0,n.segmentId,n.segmentPage);if(!a)return i;let o=e.getOffsetConfig(),{contentBoxPointGroup:s}=new r.NodePositionConvertToCursor(o,t).getRangePointData(a,a);if(s.length===0)return i;let c=(0,r.getAnchorBounding)(s),l=c.left+o.docsLeft,u=c.top+o.docsTop;return{left:l,right:l,top:u,bottom:u+c.height}}_getKeywordPlaceholderExtraProps(e){var t,n,r,i,a,o,s,c,l,u,d,f,p;return{fontSize:(t=e.ts)==null?void 0:t.fs,fontString:(n=e.fontStyle)==null?void 0:n.fontString,fontFamily:(r=(i=(a=e.fontStyle)==null?void 0:a.fontFamily)==null?(o=e.ts)==null?void 0:o.ff:i)==null?void 0:r,fontStyle:(s=e.ts)!=null&&s.it?`italic`:`normal`,fontWeight:(c=e.ts)!=null&&c.bl?`bold`:`normal`,ascent:(l=e.bBox)==null?void 0:l.ba,contentHeight:((u=(d=e.bBox)==null?void 0:d.ba)==null?0:u)+((f=(p=e.bBox)==null?void 0:p.bd)==null?0:f)||void 0}}_mountInputPlaceholder(e,t){let r=this._renderManagerService.getRenderById(e),i=r==null?void 0:r.with(n.DocSkeletonManagerService),a=this._docSelectionManagerService.getActiveTextRange();if(!r||!i||!a)return N;let o=i.getSkeleton(),s=o.findNodeByCharIndex(a.startOffset,a.segmentId,a.segmentPage);if((s==null?void 0:s.content)!==`\r`||!s)return N;let c=r.mainComponent,l=this._getKeywordPlaceholderAnchorRect(c,o,a,t),u=this._getKeywordPlaceholderExtraProps(s),d=this._docCanvasPopupManagerService.attachPopupToRect(l,{componentKey:_.componentKey,extraProps:u,onClickOutside:()=>{d.dispose()},direction:`horizontal`},e);return d}showPopup(e){let{popup:t,index:n,unitId:r}=e;this.closePopup();let i=this._getParagraphBound(r,n);if(!i)return;this._inputPlaceholderRenderRoot=this._createInputPlaceholderRenderRoot(()=>this._mountInputPlaceholder(r,i.firstLine)),this._inputPlaceholderRenderRoot.mount();let a=this._docCanvasPopupManagerService.attachPopupToRect(i.firstLine,{componentKey:E.componentKey,onClickOutside:()=>{this.closePopup()},direction:`bottom`},r);this._editPopup$.next({disposable:a,popup:t,anchor:n,unitId:r})}closePopup(){this.editPopup&&(this.editPopup.disposable.dispose(),this._editPopup$.next(null))}onMenuSelected(e){return this._menuSelectedCallbacks.add(e),()=>{this._menuSelectedCallbacks.delete(e)}}emitMenuSelected(e){let{start:t,end:n}=this.inputOffset;this._commandService.syncExecuteCommand(m.id,{start:t,end:n}),setTimeout(()=>{this._menuSelectedCallbacks.forEach(t=>t(e))},0)}};P=M([j(0,(0,t.Inject)(r.DocCanvasPopManagerService)),j(1,(0,t.Inject)(t.IUniverInstanceService)),j(2,(0,t.Inject)(t.ICommandService)),j(3,(0,t.Inject)(a.IRenderManagerService)),j(4,(0,t.Inject)(n.DocSelectionManagerService))],P);let F={type:t.CommandType.OPERATION,id:`doc.operation.show-quick-insert-popup`,handler(e,t){let n=e.get(P);return t?(n.showPopup(t),!0):!1}},I={type:t.CommandType.OPERATION,id:`doc.operation.close-quick-insert-popup`,handler(e){return e.get(P).closePopup(),!0}},te=function(e){return e.Basic=`quick.insert.group.basic`,e.Media=`quick.insert.group.media`,e}({}),L={id:`quick-insert.text.menu`,title:`docQuickInsert.menu.text`,icon:`TextIcon`,keywords:[`text`]},ne={id:r.OrderListCommand.id,title:`docQuickInsert.menu.numberedList`,icon:`OrderIcon`,keywords:[`numbered`,`list`,`ordered`]},R={id:r.BulletListCommand.id,title:`docQuickInsert.menu.bulletedList`,icon:`UnorderIcon`,keywords:[`bulleted`,`list`,`unordered`]},z={id:r.HorizontalLineCommand.id,title:`docQuickInsert.menu.divider`,icon:`DividerIcon`,keywords:[`divider`,`line`,`separate`]},B={id:r.DocCreateTableOperation.id,title:`docQuickInsert.menu.table`,icon:`GridIcon`,keywords:[`table`,`grid`,`spreadsheet`]},V={id:u.InsertDocImageCommand.id,title:`docQuickInsert.menu.image`,icon:`AdditionAndSubtractionIcon`,keywords:[`image`,`picture`,`photo`]},re=[{title:`docQuickInsert.group.basics`,id:te.Basic,children:[L,ne,R,z,B,V]}],ie=new Set([ne.id,R.id,z.id,B.id,V.id]),H=class extends t.Disposable{constructor(e,t,n,r,a){super(),this._commandService=e,this._textSelectionManagerService=t,this._docQuickInsertPopupService=n,this._shortcutService=r,this._univerInstanceService=a,this.disposeWithMe(this._shortcutService.registerShortcut({id:I.id,binding:i.KeyCode.ESC,preconditions:()=>!!this._docQuickInsertPopupService.editPopup,priority:1e3})),this._initTrigger(),this._initMenuHandler()}_initTrigger(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{let{_docQuickInsertPopupService:i,_textSelectionManagerService:a,_commandService:o}=this,s=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC);if(!(s!=null&&s.getDisabled())){if(e.id===r.InsertCommand.id){let t=e.params;if(i.editPopup){i.setInputOffset({start:i.inputOffset.start,end:t.range.endOffset+1});return}let n=a.getActiveTextRange();if(!n)return;let r=i.resolvePopup(t.body.dataStream);if(!r||!(!r.preconditions||r.preconditions(t)))return;i.setInputOffset({start:n.startOffset-1,end:n.startOffset}),setTimeout(()=>{o.executeCommand(F.id,{index:n.startOffset-1,unitId:t.unitId,popup:r})},100)}if(e.id===r.IMEInputCommand.id){let t=e.params;!i.isComposing&&t.isCompositionStart&&i.setIsComposing(!0),i.isComposing&&t.isCompositionEnd&&i.setIsComposing(!1)}if(e.id===n.RichTextEditingMutation.id){let t=e.params;if(t.isCompositionEnd){var c;let e=(c=t.textRanges)==null||(c=c[0])==null?void 0:c.endOffset;e&&i.setInputOffset({start:i.inputOffset.start,end:e})}}if(e.id===r.DeleteCommand.id){let n=e.params;if(i.editPopup&&n.direction===t.DeleteDirection.LEFT){var l;let e=(l=n.len)==null?0:l;i.setInputOffset({start:i.inputOffset.start,end:n.range.endOffset-e})}}if(e.id===r.MoveCursorOperation.id){let n=e.params;(n.direction===t.Direction.LEFT||n.direction===t.Direction.RIGHT)&&i.editPopup&&o.executeCommand(I.id)}if(e.id===r.DeleteLeftCommand.id){let e=a.getActiveTextRange();if(!i.editPopup||!e)return;e.endOffset<=i.editPopup.anchor&&o.executeCommand(I.id)}}}))}_initMenuHandler(){this.disposeWithMe(this._docQuickInsertPopupService.onMenuSelected(e=>{e.id!==L.id&&ie.has(e.id)&&this._commandService.executeCommand(e.id)}))}};H=M([j(0,t.ICommandService),j(1,(0,t.Inject)(n.DocSelectionManagerService)),j(2,(0,t.Inject)(P)),j(3,(0,t.Inject)(i.IShortcutService)),j(4,(0,t.Inject)(t.IUniverInstanceService))],H);function U({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,c=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),l=(0,s.useRef)(`_${se()}`);return W(n,`${r}`,{defIds:n.defIds,idSuffix:l.current},{ref:e,className:c,...o},a)}function W(e,t,n,r,i){return(0,s.createElement)(e.tag,{key:t,...ae(e,n,i),...r},(oe(e,n).children||[]).map((r,a)=>W(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function ae(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function oe(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function se(){return Math.random().toString(36).substring(2,8)}U.displayName=`UniverIcon`;let ce={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`}}]},G=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(U,Object.assign({},e,{id:`divider-icon`,ref:t,icon:ce}))});G.displayName=`DividerIcon`;let le={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`}}]},K=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(U,Object.assign({},e,{id:`increase-icon`,ref:t,icon:le}))});K.displayName=`IncreaseIcon`;let ue={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`]},q=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(U,Object.assign({},e,{id:`text-icon`,ref:t,icon:ue}))});q.displayName=`TextIcon`;let J=`doc.quick-insert.button`,Y=class extends t.Disposable{get popup(){return this._popup$.value}constructor(e,t,n,r){super(),this._context=e,this._docEventManagerService=t,this._docQuickInsertPopupService=n,this._docCanvasPopManagerService=r,A(this,`_popup$`,new o.BehaviorSubject(null)),A(this,`popup$`,this._popup$.asObservable()),this._init()}_init(){this.disposeWithMe((0,o.combineLatest)([this._docEventManagerService.hoverParagraphLeftRealTime$,this._docEventManagerService.hoverParagraphRealTime$]).subscribe(([e,t])=>{let n=e==null?t:e,r=this._context.unit.getDisabled();if(!n||r){this._hideMenu(!0);return}if(n.paragraphStart===n.paragraphEnd){var i;if(this._docQuickInsertPopupService.editPopup||n.startIndex===((i=this.popup)==null?void 0:i.startIndex))return;this._hideMenu(!0);let e=this._docCanvasPopManagerService.attachPopupToRect(n.firstLine,{componentKey:J,direction:`left-center`},this._context.unit.getUnitId());this._popup$.next({startIndex:n.startIndex,disposable:e})}else this._hideMenu(!0)}))}_hideMenu(e){this._docQuickInsertPopupService.editPopup||this.popup&&(e||this.popup.disposable.canDispose())&&(this.popup.disposable.dispose(),this._popup$.next(null))}};Y=M([j(1,(0,t.Inject)(r.DocEventManagerService)),j(2,(0,t.Inject)(P)),j(3,(0,t.Inject)(r.DocCanvasPopManagerService))],Y);let X=({className:e=``})=>{let r=(0,i.useDependency)(P),u=(0,i.useDependency)(t.IUniverInstanceService),d=(0,i.useDependency)(a.IRenderManagerService),f=(0,i.useObservable)((0,s.useMemo)(()=>u.getCurrentTypeOfUnit$(t.UniverInstanceType.UNIVER_DOC),[u])),p=f&&d.getRenderById(f.getUnitId()),m=p==null?void 0:p.with(Y),h=(0,i.useDependency)(i.ILayoutService),g=(0,i.useDependency)(n.DocSelectionManagerService),_=(0,i.useObservable)(r.editPopup$),v=(0,i.useEvent)(e=>{var t;let n=m==null?void 0:m.popup;if(!n)return;let i=r.popups,a={keyword:``,menus$:(0,o.combineLatest)(i.map(e=>e.menus$)).pipe((0,o.map)(e=>e.flat()))};g.replaceDocRanges([{startOffset:n.startIndex,endOffset:n.startIndex}]),r.setInputOffset({start:n.startIndex-1,end:n.startIndex-1}),r.showPopup({popup:a,index:n.startIndex-1,unitId:(t=f==null?void 0:f.getUnitId())==null?``:t}),setTimeout(()=>{h.focus()})});return(0,c.jsx)(`div`,{className:(0,l.clsx)(`
25
+ univer-mr-1 univer-flex univer-cursor-pointer univer-items-center univer-gap-2.5 univer-rounded-full
26
+ univer-p-1.5 univer-shadow-sm
27
+ hover:univer-bg-gray-100
28
+ dark:!univer-text-gray-200
29
+ dark:hover:!univer-bg-gray-700
30
+ `,l.borderClassName,{"univer-bg-gray-100 dark:!univer-bg-gray-700":_,"univer-bg-white dark:!univer-bg-gray-900":!_},e),role:`button`,tabIndex:0,onClick:v,children:(0,c.jsx)(K,{className:`
31
+ univer-text-gray-800
32
+ dark:!univer-text-gray-200
33
+ `})})};X.componentKey=J;let Z=class extends t.Disposable{constructor(e,t,n){super(),this._commandService=e,this._docQuickInsertPopupService=t,this._componentManager=n,this._initCommands(),this._initComponents(),this._initMenus()}_initCommands(){[m,F,I].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initComponents(){[[E.componentKey,E],[_.componentKey,_],[C.componentKey,C],[G.displayName,G],[q.displayName,q],[X.componentKey,X]].forEach(([e,t])=>{e&&this.disposeWithMe(this._componentManager.register(e,t))}),[{keyword:`/`,menus$:(0,o.of)(re),preconditions:e=>{var t;return((t=e.range.startNodePosition)==null?void 0:t.glyph)===0}}].forEach(e=>{this.disposeWithMe(this._docQuickInsertPopupService.registerPopup(e))})}_initMenus(){}};Z=M([j(0,t.ICommandService),j(1,(0,t.Inject)(P)),j(2,(0,t.Inject)(i.ComponentManager))],Z);var de=`@univerjs/docs-quick-insert-ui`,fe=`0.18.0`;let Q=`docs-quick-insert-ui.config`;Symbol(Q);let pe={},$=class extends t.Plugin{constructor(e=pe,n,r,i){super(),this._config=e,this._injector=n,this._renderManagerSrv=r,this._configService=i;let{menu:a,...o}=(0,t.merge)({},pe,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(Q,o)}onStarting(){[[Z],[H],[P]].forEach(e=>this._injector.add(e)),this._injector.get(Z)}onRendered(){this._injector.get(H),this._injector.get(P),[[Y]].forEach(e=>{this._renderManagerSrv.registerRenderModule(t.UniverInstanceType.UNIVER_DOC,e)})}};A($,`type`,t.UniverInstanceType.UNIVER_DOC),A($,`pluginName`,`DOC_QUICK_INSERT_UI_PLUGIN`),A($,`packageName`,de),A($,`version`,fe),$=M([(0,t.DependentOn)(p.UniverDrawingUIPlugin,f.UniverDrawingPlugin,u.UniverDocsDrawingUIPlugin,d.UniverDocsDrawingPlugin,i.UniverUIPlugin),j(1,(0,t.Inject)(t.Injector)),j(2,(0,t.Inject)(a.IRenderManagerService)),j(3,t.IConfigService)],$),Object.defineProperty(e,`DocQuickInsertPopupService`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,`DocQuickInsertTriggerController`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(e,`DocQuickInsertUIController`,{enumerable:!0,get:function(){return Z}}),e.KeywordInputPlaceholderComponentKey=h,e.QuickInsertPlaceholderComponentKey=S,Object.defineProperty(e,`UniverDocsQuickInsertUIPlugin`,{enumerable:!0,get:function(){return $}})});
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiCaES=t())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Llista numerada",bulletedList:"Llista amb vinyetes",divider:"Divisor",text:"Text",table:"Taula",image:"Imatge"},group:{basics:"Bàsics"},placeholder:"No s'han trobat resultats",keywordInputPlaceholder:"Introdueix paraules clau"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiCaES=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`Llista numerada`,bulletedList:`Llista amb vinyetes`,divider:`Divisor`,text:`Text`,table:`Taula`,image:`Imatge`},group:{basics:`Bàsics`},placeholder:`No s'han trobat resultats`,keywordInputPlaceholder:`Introdueix paraules clau`}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiEnUS=t())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Numbered List",bulletedList:"Bulleted List",divider:"Divider",text:"Text",table:"Table",image:"Image"},group:{basics:"Basics"},placeholder:"No results found",keywordInputPlaceholder:"Enter keywords"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiEnUS=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`Numbered List`,bulletedList:`Bulleted List`,divider:`Divider`,text:`Text`,table:`Table`,image:`Image`},group:{basics:`Basics`},placeholder:`No results found`,keywordInputPlaceholder:`Enter keywords`}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiEsES=t())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Lista numerada",bulletedList:"Lista con viñetas",divider:"Divisor",text:"Texto",table:"Tabla",image:"Imagen"},group:{basics:"Básicos"},placeholder:"No se han encontrado resultados",keywordInputPlaceholder:"Introduce palabras clave"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiEsES=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`Lista numerada`,bulletedList:`Lista con viñetas`,divider:`Divisor`,text:`Texto`,table:`Tabla`,image:`Imagen`},group:{basics:`Básicos`},placeholder:`No se han encontrado resultados`,keywordInputPlaceholder:`Introduce palabras clave`}}});
@@ -1 +1 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiFaIR=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"لیست شمارهدار",bulletedList:"لیست نقطهدار",divider:"خط تقسیم",text:"متن",table:"جدول",image:"تصویر"},group:{basics:"بنیادی"},placeholder:"هیچ نتیجهای یافت نشد",keywordInputPlaceholder:"وارد کلمات کلیدی"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiFaIR=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`لیست شمارهدار`,bulletedList:`لیست نقطهدار`,divider:`خط تقسیم`,text:`متن`,table:`جدول`,image:`تصویر`},group:{basics:`بنیادی`},placeholder:`هیچ نتیجهای یافت نشد`,keywordInputPlaceholder:`وارد کلمات کلیدی`}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiFrFR=t())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Liste numérotée",bulletedList:"Liste à puces",divider:"Ligne de séparation",text:"Texte",table:"Tableau",image:"Image"},group:{basics:"Basiques"},placeholder:"Aucun résultat",keywordInputPlaceholder:"Entrez des mots clés"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiFrFR=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`Liste numérotée`,bulletedList:`Liste à puces`,divider:`Ligne de séparation`,text:`Texte`,table:`Tableau`,image:`Image`},group:{basics:`Basiques`},placeholder:`Aucun résultat`,keywordInputPlaceholder:`Entrez des mots clés`}}});
@@ -1 +1 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiJaJP=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"番号付きリスト",bulletedList:"箇条書き",divider:"区切り線",text:"テキスト",table:"表",image:"画像"},group:{basics:"基本"},placeholder:"結果がありません",keywordInputPlaceholder:"キーワードを入力"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiJaJP=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`番号付きリスト`,bulletedList:`箇条書き`,divider:`区切り線`,text:`テキスト`,table:`表`,image:`画像`},group:{basics:`基本`},placeholder:`結果がありません`,keywordInputPlaceholder:`キーワードを入力`}}});
@@ -1 +1 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiKoKR=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"번호가 매겨진 목록",bulletedList:"글머리 기호 목록",divider:"구분선",text:"텍스트",table:"표",image:"이미지"},group:{basics:"기본"},placeholder:"결과가 없습니다",keywordInputPlaceholder:"키워드 입력"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiKoKR=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`번호가 매겨진 목록`,bulletedList:`글머리 기호 목록`,divider:`구분선`,text:`텍스트`,table:`표`,image:`이미지`},group:{basics:`기본`},placeholder:`결과가 없습니다`,keywordInputPlaceholder:`키워드 입력`}}});
@@ -1 +1 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiRuRU=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Список с нумерацией",bulletedList:"Маркированный список",divider:"Разделительная линия",text:"Текст",table:"Таблица",image:"Изображение"},group:{basics:"Основные"},placeholder:"Нет результатов",keywordInputPlaceholder:"Введите ключевые слова"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiRuRU=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`Список с нумерацией`,bulletedList:`Маркированный список`,divider:`Разделительная линия`,text:`Текст`,table:`Таблица`,image:`Изображение`},group:{basics:`Основные`},placeholder:`Нет результатов`,keywordInputPlaceholder:`Введите ключевые слова`}}});
@@ -1 +1 @@
1
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiSkSK=o())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Číslovaný zoznam",bulletedList:"Odrážkový zoznam",divider:"Oddeľovač",text:"Text",table:"Tabuľka",image:"Obrázok"},group:{basics:"Základy"},placeholder:"Nenašli sa žiadne výsledky",keywordInputPlaceholder:"Zadajte kľúčové slová"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiSkSK=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`Číslovaný zoznam`,bulletedList:`Odrážkový zoznam`,divider:`Oddeľovač`,text:`Text`,table:`Tabuľka`,image:`Obrázok`},group:{basics:`Základy`},placeholder:`Nenašli sa žiadne výsledky`,keywordInputPlaceholder:`Zadajte kľúčové slová`}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiViVN=n())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"Danh sách được đánh số",bulletedList:"Danh sách không được đánh số",divider:"Đường phân cách",text:"Văn bản",table:"Bảng",image:"Hình ảnh"},group:{basics:"Cơ bản"},placeholder:"Không có kết quả",keywordInputPlaceholder:"Nhập từ khóa"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiViVN=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`Danh sách được đánh số`,bulletedList:`Danh sách không được đánh số`,divider:`Đường phân cách`,text:`Văn bản`,table:`Bảng`,image:`Hình ảnh`},group:{basics:`Cơ bản`},placeholder:`Không có kết quả`,keywordInputPlaceholder:`Nhập từ khóa`}}});
@@ -1 +1 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiZhCN=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"有序列表",bulletedList:"无序列表",divider:"分隔线",text:"文本",table:"表格",image:"图片"},group:{basics:"基础"},placeholder:"暂无结果",keywordInputPlaceholder:"输入关键词"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiZhCN=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`有序列表`,bulletedList:`无序列表`,divider:`分隔线`,text:`文本`,table:`表格`,image:`图片`},group:{basics:`基础`},placeholder:`暂无结果`,keywordInputPlaceholder:`输入关键词`}}});
@@ -1 +1 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsQuickInsertUiZhTW=i())})(this,(function(){"use strict";return{docQuickInsert:{menu:{numberedList:"有序列表",bulletedList:"無序列表",divider:"分隔線",text:"文本",table:"表格",image:"圖片"},group:{basics:"基礎"},placeholder:"無結果",keywordInputPlaceholder:"輸入關鍵詞"}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsQuickInsertUiZhTW=t())})(this,function(){return{docQuickInsert:{menu:{numberedList:`有序列表`,bulletedList:`無序列表`,divider:`分隔線`,text:`文本`,table:`表格`,image:`圖片`},group:{basics:`基礎`},placeholder:`無結果`,keywordInputPlaceholder:`輸入關鍵詞`}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/docs-quick-insert-ui",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -53,16 +53,16 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@univerjs/icons": "^1.1.1",
56
- "@univerjs/core": "0.17.0",
57
- "@univerjs/design": "0.17.0",
58
- "@univerjs/docs": "0.17.0",
59
- "@univerjs/docs-drawing": "0.17.0",
60
- "@univerjs/docs-drawing-ui": "0.17.0",
61
- "@univerjs/drawing": "0.17.0",
62
- "@univerjs/drawing-ui": "0.17.0",
63
- "@univerjs/engine-render": "0.17.0",
64
- "@univerjs/docs-ui": "0.17.0",
65
- "@univerjs/ui": "0.17.0"
56
+ "@univerjs/core": "0.18.0",
57
+ "@univerjs/docs": "0.18.0",
58
+ "@univerjs/docs-drawing": "0.18.0",
59
+ "@univerjs/design": "0.18.0",
60
+ "@univerjs/docs-drawing-ui": "0.18.0",
61
+ "@univerjs/docs-ui": "0.18.0",
62
+ "@univerjs/engine-render": "0.18.0",
63
+ "@univerjs/ui": "0.18.0",
64
+ "@univerjs/drawing": "0.18.0",
65
+ "@univerjs/drawing-ui": "0.18.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "postcss": "^8.5.8",
@@ -70,16 +70,17 @@
70
70
  "rxjs": "^7.8.2",
71
71
  "tailwindcss": "3.4.18",
72
72
  "typescript": "^5.9.3",
73
- "vite": "^7.3.1",
74
- "vitest": "^4.0.18",
75
- "@univerjs-infra/shared": "0.17.0"
73
+ "vitest": "^4.1.0",
74
+ "@univerjs-infra/shared": "0.18.0"
76
75
  },
77
76
  "scripts": {
78
77
  "test": "vitest run",
79
78
  "test:watch": "vitest",
80
79
  "coverage": "vitest run --coverage",
81
80
  "typecheck": "tsc --noEmit",
82
- "build": "univer-cli build"
81
+ "build:bundle": "univer-cli build",
82
+ "build:types": "tsc -p tsconfig.node.json",
83
+ "build": "pnpm run build:bundle && pnpm run build:types"
83
84
  },
84
85
  "module": "./lib/es/index.js"
85
86
  }