@univerjs/thread-comment-ui 0.15.3 → 0.15.4
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 +3 -3
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/es/index.js +52 -52
- package/lib/es/locale/sk-SK.js +37 -0
- package/lib/index.css +1 -1
- package/lib/index.js +52 -52
- package/lib/locale/sk-SK.js +37 -0
- package/lib/types/locale/sk-SK.d.ts +3 -0
- package/lib/umd/index.js +3 -3
- package/lib/umd/locale/sk-SK.js +1 -0
- package/package.json +8 -8
package/lib/cjs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var be=Object.defineProperty;var ye=(n,e,t)=>e in n?be(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var q=(n,e,t)=>ye(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@univerjs/core"),h=require("@univerjs/ui"),ne=require("rxjs"),V=require("@univerjs/thread-comment"),i=require("react/jsx-runtime"),U=require("@univerjs/design"),c=require("react"),re=require("@univerjs/docs-ui");var Se=Object.getOwnPropertyDescriptor,we=(n,e,t,r)=>{for(var s=r>1?void 0:r?Se(e,t):e,o=n.length-1,u;o>=0;o--)(u=n[o])&&(s=u(s)||s);return s},se=(n,e)=>(t,r)=>e(t,r,n);exports.ThreadCommentPanelService=class extends d.Disposable{constructor(t,r){super();q(this,"_panelVisible",!1);q(this,"_panelVisible$",new ne.BehaviorSubject(!1));q(this,"_activeCommentId");q(this,"_activeCommentId$",new ne.BehaviorSubject(void 0));q(this,"panelVisible$",this._panelVisible$.asObservable());q(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=r,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(d.UniverInstanceType.UNIVER_SHEET).pipe(ne.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}};exports.ThreadCommentPanelService=we([se(0,d.Inject(h.ISidebarService)),se(1,d.IUniverInstanceService)],exports.ThreadCommentPanelService);const le="thread-comment-panel",_e="UNIVER_THREAD_COMMENT_UI_PLUGIN",ce={id:"thread-comment-ui.operation.toggle-panel",type:d.CommandType.OPERATION,handler(n){const e=n.get(h.ISidebarService),t=n.get(exports.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:le},width:360}),t.setPanelVisible(!0)),!0}},W={id:"thread-comment-ui.operation.set-active-comment",type:d.CommandType.OPERATION,handler(n,e){return n.get(exports.ThreadCommentPanelService).setActiveComment(e),!0}},je="thread-comment-ui.config",oe={};var Ne=Object.defineProperty,Te=Object.getOwnPropertyDescriptor,Ue=(n,e,t)=>e in n?Ne(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,De=(n,e,t,r)=>{for(var s=r>1?void 0:r?Te(e,t):e,o=n.length-1,u;o>=0;o--)(u=n[o])&&(s=u(s)||s);return s},ie=(n,e)=>(t,r)=>e(t,r,n),de=(n,e,t)=>Ue(n,typeof e!="symbol"?e+"":e,t);exports.UniverThreadCommentUIPlugin=class extends d.Plugin{constructor(e=oe,t,r,s){super(),this._config=e,this._injector=t,this._commandService=r,this._configService=s;const{menu:o,...u}=d.merge({},oe,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(je,u)}onStarting(){var e;d.mergeOverrideWithDependencies([[exports.ThreadCommentPanelService]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[ce,W].forEach(t=>{this._commandService.registerCommand(t)})}};de(exports.UniverThreadCommentUIPlugin,"pluginName",_e);de(exports.UniverThreadCommentUIPlugin,"type",d.UniverInstanceType.UNIVER_UNKNOWN);exports.UniverThreadCommentUIPlugin=De([d.DependentOn(V.UniverThreadCommentPlugin),ie(1,d.Inject(d.Injector)),ie(2,d.ICommandService),ie(3,d.IConfigService)],exports.UniverThreadCommentUIPlugin);function K({ref:n,...e}){const{icon:t,id:r,className:s,extend:o,...u}=e,y=`univerjs-icon univerjs-icon-${r} ${s||""}`.trim(),C=c.useRef(`_${ke()}`);return ue(t,`${r}`,{defIds:t.defIds,idSuffix:C.current},{ref:n,className:y,...u},o)}function ue(n,e,t,r,s){return c.createElement(n.tag,{key:e,...Ee(n,t,s),...r},($e(n,t).children||[]).map((o,u)=>ue(o,`${e}-${n.tag}-${u}`,t,void 0,s)))}function Ee(n,e,t){const r={...n.attrs};t!=null&&t.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=t.colorChannel1),n.tag==="mask"&&r.id&&(r.id=r.id+e.idSuffix),Object.entries(r).forEach(([o,u])=>{o==="mask"&&typeof u=="string"&&(r[o]=u.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))});const{defIds:s}=e;return!s||s.length===0||(n.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(([o,u])=>{typeof u=="string"&&(r[o]=u.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))})),r}function $e(n,e){var r;const{defIds:t}=e;return!t||t.length===0?n:n.tag==="defs"&&((r=n.children)!=null&&r.length)?{...n,children:n.children.map(s=>typeof s.attrs.id=="string"&&t&&t.includes(s.attrs.id)?{...s,attrs:{...s.attrs,id:s.attrs.id+e.idSuffix}}:s)}:n}function ke(){return Math.random().toString(36).substring(2,8)}K.displayName="UniverIcon";const Me={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:"M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ve=c.forwardRef(function(e,t){return c.createElement(K,Object.assign({},e,{id:"delete-icon",ref:t,icon:Me}))});ve.displayName="DeleteIcon";const Re={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"}}]},me=c.forwardRef(function(e,t){return c.createElement(K,Object.assign({},e,{id:"increase-icon",ref:t,icon:Re}))});me.displayName="IncreaseIcon";const Oe={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:"M3 9C3.55228 9 4 8.55228 4 8C4 7.44772 3.55228 7 3 7C2.44772 7 2 7.44772 2 8C2 8.55228 2.44772 9 3 9Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M13 9C13.5523 9 14 8.55228 14 8C14 7.44772 13.5523 7 13 7C12.4477 7 12 7.44772 12 8C12 8.55228 12.4477 9 13 9Z"}}]},he=c.forwardRef(function(e,t){return c.createElement(K,Object.assign({},e,{id:"more-horizontal-icon",ref:t,icon:Oe}))});he.displayName="MoreHorizontalIcon";const Pe={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:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813",strokeLinecap:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M8.91626 6.1311H9.27424",strokeLinecap:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},fe=c.forwardRef(function(e,t){return c.createElement(K,Object.assign({},e,{id:"reply-to-comment-icon",ref:t,icon:Pe}))});fe.displayName="ReplyToCommentIcon";const Le={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},pe=c.forwardRef(function(e,t){return c.createElement(K,Object.assign({},e,{id:"resolved-icon",ref:t,icon:Le}))});pe.displayName="ResolvedIcon";const He={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Ce=c.forwardRef(function(e,t){return c.createElement(K,Object.assign({},e,{id:"solve-icon",ref:t,icon:He}))});Ce.displayName="SolveIcon";function ae(n){return{id:"d",body:n,documentStyle:{}}}const ge=c.forwardRef((n,e)=>{var O;const{comment:t,onSave:r,id:s,onCancel:o,autoFocus:u,unitId:y,type:C}=n,N=h.useDependency(d.ICommandService),D=h.useDependency(d.LocaleService),[B,E]=c.useState(!1),S=h.useDependency(re.IEditorService),m=c.useRef(null),f=C===d.UniverInstanceType.UNIVER_DOC?d.DOCS_NORMAL_EDITOR_UNIT_ID_KEY:y,[$,w]=c.useState(()=>{var v,p,g;return d.BuildTextUtils.transform.getPlainText((g=(p=(v=m.current)==null?void 0:v.getDocumentData().body)==null?void 0:p.dataStream)!=null?g:"")});c.useEffect(()=>{var p,g,_,x;w(d.BuildTextUtils.transform.getPlainText((_=(g=(p=m.current)==null?void 0:p.getDocumentData().body)==null?void 0:g.dataStream)!=null?_:""));const v=(x=m.current)==null?void 0:x.selectionChange$.subscribe(()=>{var a,j,Z;w(d.BuildTextUtils.transform.getPlainText((Z=(j=(a=m.current)==null?void 0:a.getDocumentData().body)==null?void 0:j.dataStream)!=null?Z:""))});return()=>v==null?void 0:v.unsubscribe()},[(O=m.current)==null?void 0:O.selectionChange$]);const A=c.useMemo(()=>({keyCodes:[{keyCode:h.KeyCode.ENTER}],handler:v=>{v===h.KeyCode.ENTER&&N.executeCommand(re.BreakLineCommand.id)}}),[N]);c.useImperativeHandle(e,()=>({reply(v){var g,_;if(!m.current)return;S.focus((g=m.current.getEditorId())!=null?g:"");const p=ae(v);(_=m.current)==null||_.setDocumentData(p,[{startOffset:p.body.dataStream.length-2,endOffset:p.body.dataStream.length-2,collapsed:!0}])}}));const I=()=>{if(m.current){const v=d.Tools.deepClone(m.current.getDocumentData().body);E(!1),r==null||r({...t,text:v}),m.current.replaceText(""),setTimeout(()=>{var p,g;(p=m.current)==null||p.setSelectionRanges([]),(g=m.current)==null||g.blur()},10)}};return i.jsxs("div",{onClick:v=>v.preventDefault(),children:[i.jsx(re.RichTextEditor,{className:"univer-w-full",editorRef:m,editorId:d.DOCS_COMMENT_EDITOR_UNIT_ID_KEY,autoFocus:u,keyboardEventConfig:A,placeholder:D.t("threadCommentUI.editor.placeholder"),initialValue:(t==null?void 0:t.text)&&ae(t.text),onFocusChange:v=>v&&E(v),isSingle:!1,maxHeight:64,onClickOutside:()=>{setTimeout(()=>{S.focus(f)},30)}}),B?i.jsxs("div",{className:"univer-mt-3 univer-flex univer-flex-row univer-justify-end univer-gap-2",children:[i.jsx(U.Button,{onClick:()=>{var v;o==null||o(),E(!1),(v=m.current)==null||v.replaceText("",!0),N.executeCommand(W.id)},children:D.t("threadCommentUI.editor.cancel")}),i.jsx(U.Button,{variant:"primary",disabled:!$,onClick:I,children:D.t(s?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),Ve=n=>{const{dataStream:e,customRanges:t}=n,r=e.endsWith(`\r
|
|
1
|
+
"use strict";var be=Object.defineProperty;var ye=(n,e,t)=>e in n?be(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var q=(n,e,t)=>ye(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@univerjs/core"),h=require("@univerjs/ui"),ne=require("rxjs"),V=require("@univerjs/thread-comment"),i=require("react/jsx-runtime"),U=require("@univerjs/design"),c=require("react"),re=require("@univerjs/docs-ui");var Se=Object.getOwnPropertyDescriptor,_e=(n,e,t,r)=>{for(var s=r>1?void 0:r?Se(e,t):e,o=n.length-1,u;o>=0;o--)(u=n[o])&&(s=u(s)||s);return s},se=(n,e)=>(t,r)=>e(t,r,n);exports.ThreadCommentPanelService=class extends d.Disposable{constructor(t,r){super();q(this,"_panelVisible",!1);q(this,"_panelVisible$",new ne.BehaviorSubject(!1));q(this,"_activeCommentId");q(this,"_activeCommentId$",new ne.BehaviorSubject(void 0));q(this,"panelVisible$",this._panelVisible$.asObservable());q(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=r,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(d.UniverInstanceType.UNIVER_SHEET).pipe(ne.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}};exports.ThreadCommentPanelService=_e([se(0,d.Inject(h.ISidebarService)),se(1,d.IUniverInstanceService)],exports.ThreadCommentPanelService);const le="thread-comment-panel",we="UNIVER_THREAD_COMMENT_UI_PLUGIN",ce={id:"thread-comment-ui.operation.toggle-panel",type:d.CommandType.OPERATION,handler(n){const e=n.get(h.ISidebarService),t=n.get(exports.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:le},width:360}),t.setPanelVisible(!0)),!0}},W={id:"thread-comment-ui.operation.set-active-comment",type:d.CommandType.OPERATION,handler(n,e){return n.get(exports.ThreadCommentPanelService).setActiveComment(e),!0}},je="thread-comment-ui.config",oe={};var Ne=Object.defineProperty,Te=Object.getOwnPropertyDescriptor,Ue=(n,e,t)=>e in n?Ne(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,De=(n,e,t,r)=>{for(var s=r>1?void 0:r?Te(e,t):e,o=n.length-1,u;o>=0;o--)(u=n[o])&&(s=u(s)||s);return s},ie=(n,e)=>(t,r)=>e(t,r,n),de=(n,e,t)=>Ue(n,typeof e!="symbol"?e+"":e,t);exports.UniverThreadCommentUIPlugin=class extends d.Plugin{constructor(e=oe,t,r,s){super(),this._config=e,this._injector=t,this._commandService=r,this._configService=s;const{menu:o,...u}=d.merge({},oe,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(je,u)}onStarting(){var e;d.mergeOverrideWithDependencies([[exports.ThreadCommentPanelService]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[ce,W].forEach(t=>{this._commandService.registerCommand(t)})}};de(exports.UniverThreadCommentUIPlugin,"pluginName",we);de(exports.UniverThreadCommentUIPlugin,"type",d.UniverInstanceType.UNIVER_UNKNOWN);exports.UniverThreadCommentUIPlugin=De([d.DependentOn(V.UniverThreadCommentPlugin),ie(1,d.Inject(d.Injector)),ie(2,d.ICommandService),ie(3,d.IConfigService)],exports.UniverThreadCommentUIPlugin);function z({ref:n,...e}){const{icon:t,id:r,className:s,extend:o,...u}=e,y=`univerjs-icon univerjs-icon-${r} ${s||""}`.trim(),C=c.useRef(`_${ke()}`);return ue(t,`${r}`,{defIds:t.defIds,idSuffix:C.current},{ref:n,className:y,...u},o)}function ue(n,e,t,r,s){return c.createElement(n.tag,{key:e,...Ee(n,t,s),...r},($e(n,t).children||[]).map((o,u)=>ue(o,`${e}-${n.tag}-${u}`,t,void 0,s)))}function Ee(n,e,t){const r={...n.attrs};t!=null&&t.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=t.colorChannel1),n.tag==="mask"&&r.id&&(r.id=r.id+e.idSuffix),Object.entries(r).forEach(([o,u])=>{o==="mask"&&typeof u=="string"&&(r[o]=u.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))});const{defIds:s}=e;return!s||s.length===0||(n.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(([o,u])=>{typeof u=="string"&&(r[o]=u.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))})),r}function $e(n,e){var r;const{defIds:t}=e;return!t||t.length===0?n:n.tag==="defs"&&((r=n.children)!=null&&r.length)?{...n,children:n.children.map(s=>typeof s.attrs.id=="string"&&t&&t.includes(s.attrs.id)?{...s,attrs:{...s.attrs,id:s.attrs.id+e.idSuffix}}:s)}:n}function ke(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";const Me={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:"M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},me=c.forwardRef(function(e,t){return c.createElement(z,Object.assign({},e,{id:"delete-icon",ref:t,icon:Me}))});me.displayName="DeleteIcon";const Re={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"}}]},ve=c.forwardRef(function(e,t){return c.createElement(z,Object.assign({},e,{id:"increase-icon",ref:t,icon:Re}))});ve.displayName="IncreaseIcon";const Oe={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:"M3 9C3.55228 9 4 8.55228 4 8C4 7.44772 3.55228 7 3 7C2.44772 7 2 7.44772 2 8C2 8.55228 2.44772 9 3 9Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M13 9C13.5523 9 14 8.55228 14 8C14 7.44772 13.5523 7 13 7C12.4477 7 12 7.44772 12 8C12 8.55228 12.4477 9 13 9Z"}}]},he=c.forwardRef(function(e,t){return c.createElement(z,Object.assign({},e,{id:"more-horizontal-icon",ref:t,icon:Oe}))});he.displayName="MoreHorizontalIcon";const Pe={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:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813",strokeLinecap:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M8.91626 6.1311H9.27424",strokeLinecap:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},fe=c.forwardRef(function(e,t){return c.createElement(z,Object.assign({},e,{id:"reply-to-comment-icon",ref:t,icon:Pe}))});fe.displayName="ReplyToCommentIcon";const Le={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},pe=c.forwardRef(function(e,t){return c.createElement(z,Object.assign({},e,{id:"resolved-icon",ref:t,icon:Le}))});pe.displayName="ResolvedIcon";const He={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Ce=c.forwardRef(function(e,t){return c.createElement(z,Object.assign({},e,{id:"solve-icon",ref:t,icon:He}))});Ce.displayName="SolveIcon";function ae(n){return{id:"d",body:n,documentStyle:{}}}const ge=c.forwardRef((n,e)=>{var O;const{comment:t,onSave:r,id:s,onCancel:o,autoFocus:u,unitId:y,type:C}=n,N=h.useDependency(d.ICommandService),D=h.useDependency(d.LocaleService),[B,E]=c.useState(!1),S=h.useDependency(re.IEditorService),v=c.useRef(null),f=C===d.UniverInstanceType.UNIVER_DOC?d.DOCS_NORMAL_EDITOR_UNIT_ID_KEY:y,[$,_]=c.useState(()=>{var m,p,g;return d.BuildTextUtils.transform.getPlainText((g=(p=(m=v.current)==null?void 0:m.getDocumentData().body)==null?void 0:p.dataStream)!=null?g:"")});c.useEffect(()=>{var p,g,w,x;_(d.BuildTextUtils.transform.getPlainText((w=(g=(p=v.current)==null?void 0:p.getDocumentData().body)==null?void 0:g.dataStream)!=null?w:""));const m=(x=v.current)==null?void 0:x.selectionChange$.subscribe(()=>{var a,j,Z;_(d.BuildTextUtils.transform.getPlainText((Z=(j=(a=v.current)==null?void 0:a.getDocumentData().body)==null?void 0:j.dataStream)!=null?Z:""))});return()=>m==null?void 0:m.unsubscribe()},[(O=v.current)==null?void 0:O.selectionChange$]);const A=c.useMemo(()=>({keyCodes:[{keyCode:h.KeyCode.ENTER}],handler:m=>{m===h.KeyCode.ENTER&&N.executeCommand(re.BreakLineCommand.id)}}),[N]);c.useImperativeHandle(e,()=>({reply(m){var g,w;if(!v.current)return;S.focus((g=v.current.getEditorId())!=null?g:"");const p=ae(m);(w=v.current)==null||w.setDocumentData(p,[{startOffset:p.body.dataStream.length-2,endOffset:p.body.dataStream.length-2,collapsed:!0}])}}));const I=()=>{if(v.current){const m=d.Tools.deepClone(v.current.getDocumentData().body);E(!1),r==null||r({...t,text:m}),v.current.replaceText(""),setTimeout(()=>{var p,g;(p=v.current)==null||p.setSelectionRanges([]),(g=v.current)==null||g.blur()},10)}};return i.jsxs("div",{onClick:m=>m.preventDefault(),children:[i.jsx(re.RichTextEditor,{className:"univer-w-full",editorRef:v,editorId:d.DOCS_COMMENT_EDITOR_UNIT_ID_KEY,autoFocus:u,keyboardEventConfig:A,placeholder:D.t("threadCommentUI.editor.placeholder"),initialValue:(t==null?void 0:t.text)&&ae(t.text),onFocusChange:m=>m&&E(m),isSingle:!1,maxHeight:64,onClickOutside:()=>{setTimeout(()=>{S.focus(f)},30)}}),B?i.jsxs("div",{className:"univer-mt-3 univer-flex univer-flex-row univer-justify-end univer-gap-2",children:[i.jsx(U.Button,{onClick:()=>{var m;o==null||o(),E(!1),(m=v.current)==null||m.replaceText("",!0),N.executeCommand(W.id)},children:D.t("threadCommentUI.editor.cancel")}),i.jsx(U.Button,{variant:"primary",disabled:!$,onClick:I,children:D.t(s?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),Ve=n=>{const{dataStream:e,customRanges:t}=n,r=e.endsWith(`\r
|
|
2
2
|
`)?e.length-2:e.length,s=[];let o=0;return t==null||t.forEach(u=>{o<u.startIndex&&s.push({type:"text",content:e.slice(o,u.startIndex)}),s.push({type:"mention",content:{label:e.slice(u.startIndex,u.endIndex+1),id:u.rangeId}}),o=u.endIndex+1}),s.push({type:"text",content:e.slice(o,r)}),s},Be=n=>{if(!n)return[];const{paragraphs:e=[]}=n;return e.map((t,r)=>{const s=r===0?0:e[r-1].startIndex+1,o=d.getBodySlice(n,s,t.startIndex);return Ve(o)})},Ae=n=>{let e="";const t=[];return n.forEach(r=>{switch(r.type){case"text":e+=r.content;break;case"mention":{const s=e.length;e+=r.content.label;const o=e.length-1;t.push({rangeId:r.content.id,rangeType:d.CustomRangeType.MENTION,startIndex:s,endIndex:o,properties:{},wholeEntity:!0});break}}}),e+=`\r
|
|
3
|
-
`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},xe="__mock__",We=n=>{const{item:e,unitId:t,subUnitId:r,editing:s,onEditingChange:o,onReply:u,resolved:y,isRoot:C,onClose:N,onDeleteComment:D,type:B}=n,E=h.useDependency(d.ICommandService),S=h.useDependency(d.LocaleService),
|
|
4
|
-
\r`},personId:(te=M==null?void 0:M.userID)!=null?te:"",ref:s!=null?s:"",dT:"",unitId:t,subUnitId:r,threadId:""}],...(Y=a==null?void 0:a.children)!=null?Y:[]],P=c.useRef(null),J=b=>{b.stopPropagation(),k?j.executeCommand(W.id,{unitId:t,subUnitId:r,commentId:e}):j.executeCommand(W.id),j.executeCommand(V.ResolveCommentCommand.id,{unitId:t,subUnitId:r,commentId:e,resolved:!k}),$==null||$(!k)},
|
|
3
|
+
`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},xe="__mock__",We=n=>{const{item:e,unitId:t,subUnitId:r,editing:s,onEditingChange:o,onReply:u,resolved:y,isRoot:C,onClose:N,onDeleteComment:D,type:B}=n,E=h.useDependency(d.ICommandService),S=h.useDependency(d.LocaleService),v=h.useDependency(d.UserManagerService),f=v.getUser(e.personId),$=h.useObservable(v.currentUser$),_=($==null?void 0:$.userID)===e.personId,A=e.id===xe,[I,O]=c.useState(!1),m=h.useConfigValue(h.UI_PLUGIN_CONFIG_KEY),p=m==null?void 0:m.avatarFallback,g=()=>{(D==null?void 0:D(e))!==!1&&(E.executeCommand(C?V.DeleteCommentTreeCommand.id:V.DeleteCommentCommand.id,{unitId:t,subUnitId:r,commentId:e.id}),C&&(N==null||N()))};return i.jsxs("div",{className:"univer-relative univer-mb-3 univer-pl-[30px]",onMouseLeave:()=>O(!1),onMouseEnter:()=>O(!0),children:[i.jsx("div",{className:"univer-absolute univer-left-0 univer-top-0 univer-size-6 univer-rounded-full univer-bg-cover univer-bg-center univer-bg-no-repeat",style:{backgroundImage:`url(${(f==null?void 0:f.avatar)||p})`}}),f?i.jsxs("div",{className:"univer-mb-1 univer-flex univer-h-6 univer-items-center univer-justify-between",children:[i.jsx("div",{className:"univer-text-sm univer-font-medium univer-leading-5",children:(f==null?void 0:f.name)||" "}),i.jsxs("div",{children:[A||y?null:I&&f?i.jsx("div",{className:"univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",onClick:()=>u(f),children:i.jsx(fe,{})}):null,_&&!A&&!y?i.jsx(U.Dropdown,{overlay:i.jsx("div",{className:"univer-rounded-lg",children:i.jsxs("ul",{className:"univer-m-0 univer-box-border univer-grid univer-list-none univer-p-1.5 univer-text-sm [&_a]:univer-block [&_a]:univer-cursor-pointer [&_a]:univer-rounded [&_a]:univer-px-2 [&_a]:univer-py-1.5 [&_a]:univer-transition-colors",children:[i.jsx("li",{children:i.jsx("a",{className:"hover:univer-bg-gray-200",onClick:()=>o==null?void 0:o(!0),children:S.t("threadCommentUI.item.edit")})}),i.jsx("li",{children:i.jsx("a",{className:"hover:univer-bg-gray-200",onClick:g,children:S.t("threadCommentUI.item.delete")})})]})}),children:i.jsx("div",{className:"univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",children:i.jsx(he,{})})}):null]})]}):null,i.jsx("time",{className:"univer-mb-1 univer-text-xs/normal univer-text-gray-600 dark:!univer-text-gray-200",children:e.dT}),s?i.jsx(ge,{type:B,id:e.id,comment:e,onCancel:()=>o==null?void 0:o(!1),autoFocus:!0,unitId:t,subUnitId:r,onSave:({text:w,attachments:x})=>{o==null||o(!1),E.executeCommand(V.UpdateCommentCommand.id,{unitId:t,subUnitId:r,payload:{commentId:e.id,text:w,attachments:x}})}}):i.jsx("div",{className:"univer-text-sm univer-text-gray-900 dark:!univer-text-white",children:Be(e.text).map((w,x)=>i.jsx("div",{className:"univer-break-words",children:w.map((a,j)=>a.type==="mention"?i.jsxs("a",{className:"univer-text-primary-600",children:[a.content.label," "]},j):a.content)},x))})]})},Ie=n=>{var te,Y,l;const{id:e,unitId:t,subUnitId:r,refStr:s,showEdit:o=!0,onClick:u,showHighlight:y,onClose:C,getSubUnitName:N,prefix:D,autoFocus:B,onMouseEnter:E,onMouseLeave:S,onAddComment:v,onDeleteComment:f,onResolve:$,type:_,style:A,full:I}=n,O=h.useDependency(V.ThreadCommentModel),[m,p]=c.useState(!1),[g,w]=c.useState(""),x=c.useMemo(()=>O.commentUpdate$.pipe(ne.debounceTime(16)),[O]);h.useObservable(x);const a=e?O.getCommentWithChildren(t,r,e):null,j=h.useDependency(d.ICommandService),Z=h.useDependency(d.UserManagerService),k=a==null?void 0:a.root.resolved,M=h.useObservable(Z.currentUser$),L=c.useRef(null),K=[...a?[a.root]:[{id:xe,text:{dataStream:`
|
|
4
|
+
\r`},personId:(te=M==null?void 0:M.userID)!=null?te:"",ref:s!=null?s:"",dT:"",unitId:t,subUnitId:r,threadId:""}],...(Y=a==null?void 0:a.children)!=null?Y:[]],P=c.useRef(null),J=b=>{b.stopPropagation(),k?j.executeCommand(W.id,{unitId:t,subUnitId:r,commentId:e}):j.executeCommand(W.id),j.executeCommand(V.ResolveCommentCommand.id,{unitId:t,subUnitId:r,commentId:e,resolved:!k}),$==null||$(!k)},G=b=>{b.stopPropagation(),j.executeCommand(W.id),!(a!=null&&a.root&&(f==null?void 0:f(a.root))===!1)&&(j.executeCommand(V.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:r,commentId:e}),C==null||C())};c.useEffect(()=>S==null?void 0:S(),[]);const Q=N((l=a==null?void 0:a.root.subUnitId)!=null?l:r),X=o&&!g&&!k,ee=`${s||(a==null?void 0:a.root.ref)||""}${Q?" · ":""}${Q}`;return i.jsxs("div",{id:`${D}-${t}-${r}-${e}`,className:U.clsx("univer-relative univer-box-border univer-rounded-md univer-bg-white univer-p-4 dark:!univer-bg-gray-900 dark:!univer-text-white",U.borderClassName,{"univer-w-[278px]":!I,"univer-w-full":I,"univer-shadow":!k&&(y||m||D==="cell")}),style:A,onClick:u,onMouseEnter:()=>{E==null||E(),p(!0)},onMouseLeave:()=>{S==null||S(),p(!1)},children:[!k&&y&&i.jsx("div",{className:"univer-absolute univer-left-0 univer-right-0 univer-top-0 univer-h-1.5 univer-rounded-t-md univer-bg-yellow-400"}),i.jsxs("div",{className:"univer-mb-4 univer-flex univer-flex-row univer-items-center univer-justify-between univer-text-sm univer-leading-5",children:[i.jsxs("div",{className:"univer-flex univer-flex-1 univer-flex-row univer-items-center univer-overflow-hidden",children:[i.jsx("div",{className:"univer-mr-2 univer-h-3.5 univer-w-[3px] univer-flex-shrink-0 univer-flex-grow-0 univer-rounded-sm univer-bg-yellow-500"}),i.jsx(U.Tooltip,{showIfEllipsis:!0,title:ee,children:i.jsx("span",{className:"univer-flex-1 univer-truncate",children:ee})})]}),!!a&&i.jsxs("div",{className:"univer-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-row",children:[i.jsx("div",{className:U.clsx("univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800",{"univer-text-green-500":k}),onClick:J,children:k?i.jsx(pe,{}):i.jsx(Ce,{})}),(M==null?void 0:M.userID)===a.root.personId?i.jsx("div",{className:"univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800",onClick:G,children:i.jsx(me,{})}):null]})]}),i.jsx("div",{ref:P,className:U.clsx("univer-max-h-80 univer-overflow-y-auto univer-overflow-x-hidden",U.scrollbarClassName),children:K.map(b=>i.jsx(We,{unitId:t,subUnitId:r,item:b,isRoot:b.id===(a==null?void 0:a.root.id),editing:g===b.id,resolved:a==null?void 0:a.root.resolved,type:_,onClose:C,onEditingChange:R=>{w(R?b.id:"")},onReply:R=>{R&&requestAnimationFrame(()=>{var H;(H=L.current)==null||H.reply(Ae([{type:"mention",content:{id:R.userID,label:`@${R.name}`}},{type:"text",content:" "}]))})},onAddComment:v,onDeleteComment:f},b.id))}),X&&i.jsx("div",{children:i.jsx(ge,{ref:L,type:_,unitId:t,subUnitId:r,onSave:async({text:b,attachments:R})=>{const H={text:b,attachments:R,dT:V.getDT(),id:d.generateRandomId(),ref:s,personId:M==null?void 0:M.userID,parentId:a==null?void 0:a.root.id,unitId:t,subUnitId:r,threadId:a==null?void 0:a.root.threadId};(v==null?void 0:v(H))!==!1&&(await j.executeCommand(V.AddCommentCommand.id,{unitId:t,subUnitId:r,comment:H}),P.current&&(P.current.scrollTop=P.current.scrollHeight))},autoFocus:B||!a,onCancel:()=>{a||C==null||C()}},`${B}`)})]})},Ze=n=>{const{unitId:e,subUnitId$:t,type:r,onAdd:s,getSubUnitName:o,onResolve:u,sortComments:y,onItemLeave:C,onItemEnter:N,disableAdd:D,tempComment:B,onAddComment:E,onDeleteComment:S,showComments:v}=n,[f,$]=c.useState("all"),[_,A]=c.useState("all"),I=h.useDependency(d.LocaleService),O=h.useDependency(d.UserManagerService),m=h.useDependency(V.ThreadCommentModel),[p,g]=c.useState(()=>m.getUnit(e)),w=h.useDependency(exports.ThreadCommentPanelService),x=h.useObservable(w.activeCommentId$),a=h.useObservable(m.commentUpdate$),j=h.useDependency(d.ICommandService),Z=h.useObservable(t),k=c.useRef(!0),M="panel",L=h.useObservable(O.currentUser$),K=c.useMemo(()=>{var H;const l=f==="all"?p:(H=p.filter(T=>T.subUnitId===Z))!=null?H:[],b=y!=null?y:(T=>T),R=l.map(T=>{var F;return{...T.root,children:(F=T.children)!=null?F:[],users:T.relativeUsers}});if(v){const T=new Map;return R.forEach(F=>{T.set(F.id,F)}),[...v,""].map(F=>T.get(F)).filter(Boolean)}else return b(R)},[v,f,p,y,Z]),P=c.useMemo(()=>[...K.filter(l=>!l.resolved),...K.filter(l=>l.resolved)],[K]),J=c.useMemo(()=>_==="resolved"?P.filter(l=>l.resolved):_==="unsolved"?P.filter(l=>!l.resolved):_==="concern_me"&&L!=null&&L.userID?P.filter(l=>l==null?void 0:l.users.has(L.userID)):P,[P,L==null?void 0:L.userID,_]),G=B?[B,...J]:J,Q=G.filter(l=>!l.resolved),X=G.filter(l=>l.resolved),ee=_!=="all"||f!=="all",te=()=>{A("all"),$("all")};c.useEffect(()=>{e&&g(m.getUnit(e))},[e,m,a]),c.useEffect(()=>{var T;if(!x)return;if(!k.current){k.current=!0;return}const{unitId:l,subUnitId:b,commentId:R}=x,H=`${M}-${l}-${b}-${R}`;(T=document.getElementById(H))==null||T.scrollIntoView({block:"center"})},[x]);const Y=l=>i.jsx(Ie,{prefix:M,getSubUnitName:o,id:l.id,unitId:l.unitId,subUnitId:l.subUnitId,refStr:l.ref,type:r,showEdit:(x==null?void 0:x.commentId)===l.id,showHighlight:(x==null?void 0:x.commentId)===l.id,onClick:()=>{k.current=!1,l.resolved?j.executeCommand(W.id):j.executeCommand(W.id,{unitId:l.unitId,subUnitId:l.subUnitId,commentId:l.id,temp:!1})},onMouseEnter:()=>N==null?void 0:N(l),onMouseLeave:()=>C==null?void 0:C(l),onAddComment:E,onDeleteComment:S,onResolve:b=>u==null?void 0:u(l.id,b)},l.id);return i.jsxs("div",{className:"univer-flex univer-min-h-full univer-flex-col univer-pb-3",children:[i.jsxs("div",{className:"univer-mt-3 univer-flex univer-flex-row univer-justify-between",children:[r===d.UniverInstanceType.UNIVER_SHEET?i.jsx(U.Select,{borderless:!0,value:f,options:[{value:"current",label:I.t("threadCommentUI.filter.sheet.current")},{value:"all",label:I.t("threadCommentUI.filter.sheet.all")}],onChange:$}):null,i.jsx(U.Select,{borderless:!0,value:_,options:[{value:"all",label:I.t("threadCommentUI.filter.status.all")},{value:"resolved",label:I.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:I.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:I.t("threadCommentUI.filter.status.concernMe")}],onChange:A})]}),G.length===0?i.jsxs("div",{className:"univer-flex univer-flex-1 univer-flex-col univer-items-center univer-justify-center univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:[I.t("threadCommentUI.panel.empty"),ee?i.jsx("div",{className:"univer-mt-2 univer-flex univer-flex-row",children:i.jsx(U.Button,{onClick:te,children:I.t("threadCommentUI.panel.reset")})}):D?null:i.jsx("div",{className:"univer-mt-2 univer-flex univer-flex-row",children:i.jsxs(U.Button,{onClick:s,children:[i.jsx(ve,{className:"univer-mr-1.5"}),I.t("threadCommentUI.panel.addComment")]})})]}):i.jsxs("div",{className:"univer-mt-3 univer-flex univer-flex-col univer-gap-3",children:[Q.map(Y),X.length>0&&i.jsx("div",{className:"univer-text-xs",children:I.t("threadCommentUI.panel.solved")}),X.map(Y)]})]})};exports.SetActiveCommentOperation=W;exports.THREAD_COMMENT_PANEL=le;exports.ThreadCommentPanel=Ze;exports.ThreadCommentTree=Ie;exports.ToggleSheetCommentPanelOperation=ce;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e={threadCommentUI:{panel:{title:"Správa komentárov",empty:"Zatiaľ žiadne komentáre",filterEmpty:"Žiadne zodpovedajúce výsledky",reset:"Obnoviť filter",addComment:"Pridať komentár",solved:"Vyriešené"},editor:{placeholder:"Odpovedzte alebo pridajte ostatných pomocou @",reply:"Komentovať",cancel:"Zrušiť",save:"Uložiť"},item:{edit:"Upraviť",delete:"Odstrániť tento komentár"},filter:{sheet:{all:"Všetky hárky",current:"Aktuálny hárok"},status:{all:"Všetky komentáre",resolved:"Vyriešené",unsolved:"Nevyriešené",concernMe:"Týka sa ma"}}}};module.exports=e;
|
package/lib/es/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var He = Object.defineProperty;
|
|
2
2
|
var Ve = (r, e, t) => e in r ? He(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var W = (r, e, t) => Ve(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { Inject as ye, IUniverInstanceService as je, Disposable as Pe, UniverInstanceType as de, CommandType as
|
|
5
|
-
import { ISidebarService as
|
|
4
|
+
import { Inject as ye, IUniverInstanceService as je, Disposable as Pe, UniverInstanceType as de, CommandType as _e, DependentOn as Ae, Injector as Be, ICommandService as te, IConfigService as We, Plugin as Ze, merge as Fe, mergeOverrideWithDependencies as ze, LocaleService as he, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ke, BuildTextUtils as ue, DOCS_COMMENT_EDITOR_UNIT_ID_KEY as Ge, Tools as Ye, CustomRangeType as qe, getBodySlice as Je, UserManagerService as fe, generateRandomId as Qe } from "@univerjs/core";
|
|
5
|
+
import { ISidebarService as we, useDependency as N, KeyCode as pe, useObservable as Z, useConfigValue as Xe, UI_PLUGIN_CONFIG_KEY as et } from "@univerjs/ui";
|
|
6
6
|
import { BehaviorSubject as Ce, filter as tt, debounceTime as rt } from "rxjs";
|
|
7
7
|
import { UniverThreadCommentPlugin as nt, ThreadCommentModel as Ne, getDT as it, AddCommentCommand as ot, ResolveCommentCommand as st, DeleteCommentTreeCommand as Se, UpdateCommentCommand as at, DeleteCommentCommand as lt } from "@univerjs/thread-comment";
|
|
8
8
|
import { jsxs as I, jsx as a } from "react/jsx-runtime";
|
|
9
9
|
import { Button as ae, clsx as ve, Tooltip as ct, scrollbarClassName as dt, borderClassName as ut, Dropdown as vt, Select as ge } from "@univerjs/design";
|
|
10
|
-
import { useRef as ee, createElement as
|
|
10
|
+
import { useRef as ee, createElement as z, forwardRef as K, useState as P, useEffect as le, useMemo as X, useImperativeHandle as mt } from "react";
|
|
11
11
|
import { IEditorService as ht, BreakLineCommand as ft, RichTextEditor as pt } from "@univerjs/docs-ui";
|
|
12
12
|
var Ct = Object.getOwnPropertyDescriptor, gt = (r, e, t, n) => {
|
|
13
13
|
for (var i = n > 1 ? void 0 : n ? Ct(e, t) : e, o = r.length - 1, c; o >= 0; o--)
|
|
@@ -52,14 +52,14 @@ let Y = class extends Pe {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
Y = gt([
|
|
55
|
-
Ie(0, ye(
|
|
55
|
+
Ie(0, ye(we)),
|
|
56
56
|
Ie(1, je)
|
|
57
57
|
], Y);
|
|
58
58
|
const It = "thread-comment-panel", xt = "UNIVER_THREAD_COMMENT_UI_PLUGIN", bt = {
|
|
59
59
|
id: "thread-comment-ui.operation.toggle-panel",
|
|
60
|
-
type:
|
|
60
|
+
type: _e.OPERATION,
|
|
61
61
|
handler(r) {
|
|
62
|
-
const e = r.get(
|
|
62
|
+
const e = r.get(we), t = r.get(Y);
|
|
63
63
|
return t.panelVisible ? (e.close(), t.setPanelVisible(!1)) : (e.open({
|
|
64
64
|
header: { title: "threadCommentUI.panel.title" },
|
|
65
65
|
children: { label: It },
|
|
@@ -68,13 +68,13 @@ const It = "thread-comment-panel", xt = "UNIVER_THREAD_COMMENT_UI_PLUGIN", bt =
|
|
|
68
68
|
}
|
|
69
69
|
}, F = {
|
|
70
70
|
id: "thread-comment-ui.operation.set-active-comment",
|
|
71
|
-
type:
|
|
71
|
+
type: _e.OPERATION,
|
|
72
72
|
handler(r, e) {
|
|
73
73
|
return r.get(Y).setActiveComment(e), !0;
|
|
74
74
|
}
|
|
75
75
|
}, yt = "thread-comment-ui.config", xe = {};
|
|
76
|
-
var
|
|
77
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
76
|
+
var _t = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, Nt = (r, e, t) => e in r ? _t(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, St = (r, e, t, n) => {
|
|
77
|
+
for (var i = n > 1 ? void 0 : n ? wt(e, t) : e, o = r.length - 1, c; o >= 0; o--)
|
|
78
78
|
(c = r[o]) && (i = c(i) || i);
|
|
79
79
|
return i;
|
|
80
80
|
}, me = (r, e) => (t, n) => e(t, n, r), $e = (r, e, t) => Nt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
@@ -90,7 +90,7 @@ let ce = class extends Ze {
|
|
|
90
90
|
}
|
|
91
91
|
onStarting() {
|
|
92
92
|
var r;
|
|
93
|
-
|
|
93
|
+
ze([
|
|
94
94
|
[Y]
|
|
95
95
|
], (r = this._config) == null ? void 0 : r.overrides).forEach((e) => {
|
|
96
96
|
this._injector.add(e);
|
|
@@ -107,7 +107,7 @@ ce = St([
|
|
|
107
107
|
me(2, te),
|
|
108
108
|
me(3, We)
|
|
109
109
|
], ce);
|
|
110
|
-
function
|
|
110
|
+
function G({ ref: r, ...e }) {
|
|
111
111
|
const { icon: t, id: n, className: i, extend: o, ...c } = e, x = `univerjs-icon univerjs-icon-${n} ${i || ""}`.trim(), h = ee(`_${kt()}`);
|
|
112
112
|
return Ue(t, `${n}`, {
|
|
113
113
|
defIds: t.defIds,
|
|
@@ -119,7 +119,7 @@ function z({ ref: r, ...e }) {
|
|
|
119
119
|
}, o);
|
|
120
120
|
}
|
|
121
121
|
function Ue(r, e, t, n, i) {
|
|
122
|
-
return
|
|
122
|
+
return z(r.tag, {
|
|
123
123
|
key: e,
|
|
124
124
|
...$t(r, t, i),
|
|
125
125
|
...n
|
|
@@ -152,7 +152,7 @@ function Ut(r, e) {
|
|
|
152
152
|
function kt() {
|
|
153
153
|
return Math.random().toString(36).substring(2, 8);
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
G.displayName = "UniverIcon";
|
|
156
156
|
const Tt = {
|
|
157
157
|
tag: "svg",
|
|
158
158
|
attrs: {
|
|
@@ -194,8 +194,8 @@ const Tt = {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
]
|
|
197
|
-
}, ke =
|
|
198
|
-
return
|
|
197
|
+
}, ke = K(function(e, t) {
|
|
198
|
+
return z(G, Object.assign({}, e, {
|
|
199
199
|
id: "delete-icon",
|
|
200
200
|
ref: t,
|
|
201
201
|
icon: Tt
|
|
@@ -218,8 +218,8 @@ const Dt = {
|
|
|
218
218
|
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"
|
|
219
219
|
}
|
|
220
220
|
}]
|
|
221
|
-
}, Te =
|
|
222
|
-
return
|
|
221
|
+
}, Te = K(function(e, t) {
|
|
222
|
+
return z(G, Object.assign({}, e, {
|
|
223
223
|
id: "increase-icon",
|
|
224
224
|
ref: t,
|
|
225
225
|
icon: Dt
|
|
@@ -258,8 +258,8 @@ const Et = {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
]
|
|
261
|
-
}, De =
|
|
262
|
-
return
|
|
261
|
+
}, De = K(function(e, t) {
|
|
262
|
+
return z(G, Object.assign({}, e, {
|
|
263
263
|
id: "more-horizontal-icon",
|
|
264
264
|
ref: t,
|
|
265
265
|
icon: Et
|
|
@@ -324,8 +324,8 @@ const Mt = {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
]
|
|
327
|
-
}, Ee =
|
|
328
|
-
return
|
|
327
|
+
}, Ee = K(function(e, t) {
|
|
328
|
+
return z(G, Object.assign({}, e, {
|
|
329
329
|
id: "reply-to-comment-icon",
|
|
330
330
|
ref: t,
|
|
331
331
|
icon: Mt
|
|
@@ -350,8 +350,8 @@ const Ot = {
|
|
|
350
350
|
clipRule: "evenodd"
|
|
351
351
|
}
|
|
352
352
|
}]
|
|
353
|
-
}, Me =
|
|
354
|
-
return
|
|
353
|
+
}, Me = K(function(e, t) {
|
|
354
|
+
return z(G, Object.assign({}, e, {
|
|
355
355
|
id: "resolved-icon",
|
|
356
356
|
ref: t,
|
|
357
357
|
icon: Ot
|
|
@@ -386,8 +386,8 @@ const Rt = {
|
|
|
386
386
|
strokeWidth: 1.2
|
|
387
387
|
}
|
|
388
388
|
}]
|
|
389
|
-
}, Oe =
|
|
390
|
-
return
|
|
389
|
+
}, Oe = K(function(e, t) {
|
|
390
|
+
return z(G, Object.assign({}, e, {
|
|
391
391
|
id: "solve-icon",
|
|
392
392
|
ref: t,
|
|
393
393
|
icon: Rt
|
|
@@ -401,18 +401,18 @@ function be(r) {
|
|
|
401
401
|
documentStyle: {}
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
|
-
const Re =
|
|
404
|
+
const Re = K((r, e) => {
|
|
405
405
|
var O;
|
|
406
|
-
const { comment: t, onSave: n, id: i, onCancel: o, autoFocus: c, unitId: x, type: h } = r, S = N(te), U = N(he), [V, k] = P(!1), b = N(ht), u = ee(null), v = h === de.UNIVER_DOC ?
|
|
406
|
+
const { comment: t, onSave: n, id: i, onCancel: o, autoFocus: c, unitId: x, type: h } = r, S = N(te), U = N(he), [V, k] = P(!1), b = N(ht), u = ee(null), v = h === de.UNIVER_DOC ? Ke : x, [T, y] = P(() => {
|
|
407
407
|
var d, m, f;
|
|
408
408
|
return ue.transform.getPlainText((f = (m = (d = u.current) == null ? void 0 : d.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? f : "");
|
|
409
409
|
});
|
|
410
410
|
le(() => {
|
|
411
|
-
var m, f,
|
|
412
|
-
y(ue.transform.getPlainText((
|
|
411
|
+
var m, f, _, p;
|
|
412
|
+
y(ue.transform.getPlainText((_ = (f = (m = u.current) == null ? void 0 : m.getDocumentData().body) == null ? void 0 : f.dataStream) != null ? _ : ""));
|
|
413
413
|
const d = (p = u.current) == null ? void 0 : p.selectionChange$.subscribe(() => {
|
|
414
|
-
var s,
|
|
415
|
-
y(ue.transform.getPlainText((A = (
|
|
414
|
+
var s, w, A;
|
|
415
|
+
y(ue.transform.getPlainText((A = (w = (s = u.current) == null ? void 0 : s.getDocumentData().body) == null ? void 0 : w.dataStream) != null ? A : ""));
|
|
416
416
|
});
|
|
417
417
|
return () => d == null ? void 0 : d.unsubscribe();
|
|
418
418
|
}, [(O = u.current) == null ? void 0 : O.selectionChange$]);
|
|
@@ -426,12 +426,12 @@ const Re = G((r, e) => {
|
|
|
426
426
|
}), [S]);
|
|
427
427
|
mt(e, () => ({
|
|
428
428
|
reply(d) {
|
|
429
|
-
var f,
|
|
429
|
+
var f, _;
|
|
430
430
|
if (!u.current)
|
|
431
431
|
return;
|
|
432
432
|
b.focus((f = u.current.getEditorId()) != null ? f : "");
|
|
433
433
|
const m = be(d);
|
|
434
|
-
(
|
|
434
|
+
(_ = u.current) == null || _.setDocumentData(m, [{
|
|
435
435
|
startOffset: m.body.dataStream.length - 2,
|
|
436
436
|
endOffset: m.body.dataStream.length - 2,
|
|
437
437
|
collapsed: !0
|
|
@@ -456,7 +456,7 @@ const Re = G((r, e) => {
|
|
|
456
456
|
{
|
|
457
457
|
className: "univer-w-full",
|
|
458
458
|
editorRef: u,
|
|
459
|
-
editorId:
|
|
459
|
+
editorId: Ge,
|
|
460
460
|
autoFocus: c,
|
|
461
461
|
keyboardEventConfig: j,
|
|
462
462
|
placeholder: U.t("threadCommentUI.editor.placeholder"),
|
|
@@ -575,7 +575,7 @@ const Re = G((r, e) => {
|
|
|
575
575
|
/* @__PURE__ */ a(
|
|
576
576
|
"div",
|
|
577
577
|
{
|
|
578
|
-
className: "univer-absolute univer-left-0 univer-top-0 univer-
|
|
578
|
+
className: "univer-absolute univer-left-0 univer-top-0 univer-size-6 univer-rounded-full univer-bg-cover univer-bg-center univer-bg-no-repeat",
|
|
579
579
|
style: {
|
|
580
580
|
backgroundImage: `url(${(v == null ? void 0 : v.avatar) || m})`
|
|
581
581
|
}
|
|
@@ -587,7 +587,7 @@ const Re = G((r, e) => {
|
|
|
587
587
|
j || x ? null : C && v ? /* @__PURE__ */ a(
|
|
588
588
|
"div",
|
|
589
589
|
{
|
|
590
|
-
className: "univer-ml-1 univer-inline-flex univer-
|
|
590
|
+
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",
|
|
591
591
|
onClick: () => c(v),
|
|
592
592
|
children: /* @__PURE__ */ a(Ee, {})
|
|
593
593
|
}
|
|
@@ -622,7 +622,7 @@ const Re = G((r, e) => {
|
|
|
622
622
|
children: /* @__PURE__ */ a(
|
|
623
623
|
"div",
|
|
624
624
|
{
|
|
625
|
-
className: "univer-ml-1 univer-inline-flex univer-
|
|
625
|
+
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",
|
|
626
626
|
children: /* @__PURE__ */ a(De, {})
|
|
627
627
|
}
|
|
628
628
|
)
|
|
@@ -647,7 +647,7 @@ const Re = G((r, e) => {
|
|
|
647
647
|
autoFocus: !0,
|
|
648
648
|
unitId: t,
|
|
649
649
|
subUnitId: n,
|
|
650
|
-
onSave: ({ text:
|
|
650
|
+
onSave: ({ text: _, attachments: p }) => {
|
|
651
651
|
o == null || o(!1), k.executeCommand(
|
|
652
652
|
at.id,
|
|
653
653
|
{
|
|
@@ -655,7 +655,7 @@ const Re = G((r, e) => {
|
|
|
655
655
|
subUnitId: n,
|
|
656
656
|
payload: {
|
|
657
657
|
commentId: e.id,
|
|
658
|
-
text:
|
|
658
|
+
text: _,
|
|
659
659
|
attachments: p
|
|
660
660
|
}
|
|
661
661
|
}
|
|
@@ -666,10 +666,10 @@ const Re = G((r, e) => {
|
|
|
666
666
|
"div",
|
|
667
667
|
{
|
|
668
668
|
className: "univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
669
|
-
children: Ht(e.text).map((
|
|
669
|
+
children: Ht(e.text).map((_, p) => /* @__PURE__ */ a("div", { className: "univer-break-words", children: _.map((s, w) => s.type === "mention" ? /* @__PURE__ */ I("a", { className: "univer-text-primary-600", children: [
|
|
670
670
|
s.content.label,
|
|
671
671
|
" "
|
|
672
|
-
] },
|
|
672
|
+
] }, w) : s.content) }, p))
|
|
673
673
|
}
|
|
674
674
|
)
|
|
675
675
|
] });
|
|
@@ -695,9 +695,9 @@ const Re = G((r, e) => {
|
|
|
695
695
|
type: y,
|
|
696
696
|
style: j,
|
|
697
697
|
full: C
|
|
698
|
-
} = r, O = N(Ne), [d, m] = P(!1), [f,
|
|
698
|
+
} = r, O = N(Ne), [d, m] = P(!1), [f, _] = P(""), p = X(() => O.commentUpdate$.pipe(rt(16)), [O]);
|
|
699
699
|
Z(p);
|
|
700
|
-
const s = e ? O.getCommentWithChildren(t, n, e) : null,
|
|
700
|
+
const s = e ? O.getCommentWithChildren(t, n, e) : null, w = N(te), A = N(fe), D = s == null ? void 0 : s.root.resolved, E = Z(A.currentUser$), L = ee(null), q = [
|
|
701
701
|
...s ? [s.root] : (
|
|
702
702
|
// mock empty comment
|
|
703
703
|
[{
|
|
@@ -716,18 +716,18 @@ const Re = G((r, e) => {
|
|
|
716
716
|
),
|
|
717
717
|
...(Q = s == null ? void 0 : s.children) != null ? Q : []
|
|
718
718
|
], R = ee(null), re = (g) => {
|
|
719
|
-
g.stopPropagation(), D ?
|
|
719
|
+
g.stopPropagation(), D ? w.executeCommand(F.id, {
|
|
720
720
|
unitId: t,
|
|
721
721
|
subUnitId: n,
|
|
722
722
|
commentId: e
|
|
723
|
-
}) :
|
|
723
|
+
}) : w.executeCommand(F.id), w.executeCommand(st.id, {
|
|
724
724
|
unitId: t,
|
|
725
725
|
subUnitId: n,
|
|
726
726
|
commentId: e,
|
|
727
727
|
resolved: !D
|
|
728
728
|
}), T == null || T(!D);
|
|
729
729
|
}, J = (g) => {
|
|
730
|
-
g.stopPropagation(),
|
|
730
|
+
g.stopPropagation(), w.executeCommand(F.id), !(s != null && s.root && (v == null ? void 0 : v(s.root)) === !1) && (w.executeCommand(
|
|
731
731
|
Se.id,
|
|
732
732
|
{
|
|
733
733
|
unitId: t,
|
|
@@ -786,7 +786,7 @@ const Re = G((r, e) => {
|
|
|
786
786
|
/* @__PURE__ */ a(
|
|
787
787
|
"div",
|
|
788
788
|
{
|
|
789
|
-
className: ve("univer-ml-1 univer-inline-flex univer-
|
|
789
|
+
className: ve("univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800", {
|
|
790
790
|
"univer-text-green-500": D
|
|
791
791
|
}),
|
|
792
792
|
onClick: re,
|
|
@@ -796,7 +796,7 @@ const Re = G((r, e) => {
|
|
|
796
796
|
(E == null ? void 0 : E.userID) === s.root.personId ? /* @__PURE__ */ a(
|
|
797
797
|
"div",
|
|
798
798
|
{
|
|
799
|
-
className: "univer-ml-1 univer-inline-flex univer-
|
|
799
|
+
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800",
|
|
800
800
|
onClick: J,
|
|
801
801
|
children: /* @__PURE__ */ a(ke, {})
|
|
802
802
|
}
|
|
@@ -823,7 +823,7 @@ const Re = G((r, e) => {
|
|
|
823
823
|
type: y,
|
|
824
824
|
onClose: h,
|
|
825
825
|
onEditingChange: (M) => {
|
|
826
|
-
|
|
826
|
+
_(M ? g.id : "");
|
|
827
827
|
},
|
|
828
828
|
onReply: (M) => {
|
|
829
829
|
M && requestAnimationFrame(() => {
|
|
@@ -871,7 +871,7 @@ const Re = G((r, e) => {
|
|
|
871
871
|
subUnitId: n,
|
|
872
872
|
threadId: s == null ? void 0 : s.root.threadId
|
|
873
873
|
};
|
|
874
|
-
(u == null ? void 0 : u(H)) !== !1 && (await
|
|
874
|
+
(u == null ? void 0 : u(H)) !== !1 && (await w.executeCommand(
|
|
875
875
|
ot.id,
|
|
876
876
|
{
|
|
877
877
|
unitId: t,
|
|
@@ -906,7 +906,7 @@ const Re = G((r, e) => {
|
|
|
906
906
|
onAddComment: k,
|
|
907
907
|
onDeleteComment: b,
|
|
908
908
|
showComments: u
|
|
909
|
-
} = r, [v, T] = P("all"), [y, j] = P("all"), C = N(he), O = N(fe), d = N(Ne), [m, f] = P(() => d.getUnit(e)),
|
|
909
|
+
} = r, [v, T] = P("all"), [y, j] = P("all"), C = N(he), O = N(fe), d = N(Ne), [m, f] = P(() => d.getUnit(e)), _ = N(Y), p = Z(_.activeCommentId$), s = Z(d.commentUpdate$), w = N(te), A = Z(t), D = ee(!0), E = "panel", L = Z(O.currentUser$), q = X(() => {
|
|
910
910
|
var H;
|
|
911
911
|
const l = v === "all" ? m : (H = m.filter(($) => $.subUnitId === A)) != null ? H : [], g = x != null ? x : (($) => $), M = l.map(($) => {
|
|
912
912
|
var B;
|
|
@@ -953,7 +953,7 @@ const Re = G((r, e) => {
|
|
|
953
953
|
showEdit: (p == null ? void 0 : p.commentId) === l.id,
|
|
954
954
|
showHighlight: (p == null ? void 0 : p.commentId) === l.id,
|
|
955
955
|
onClick: () => {
|
|
956
|
-
D.current = !1, l.resolved ?
|
|
956
|
+
D.current = !1, l.resolved ? w.executeCommand(F.id) : w.executeCommand(
|
|
957
957
|
F.id,
|
|
958
958
|
{
|
|
959
959
|
unitId: l.unitId,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
threadCommentUI: {
|
|
3
|
+
panel: {
|
|
4
|
+
title: "Správa komentárov",
|
|
5
|
+
empty: "Zatiaľ žiadne komentáre",
|
|
6
|
+
filterEmpty: "Žiadne zodpovedajúce výsledky",
|
|
7
|
+
reset: "Obnoviť filter",
|
|
8
|
+
addComment: "Pridať komentár",
|
|
9
|
+
solved: "Vyriešené"
|
|
10
|
+
},
|
|
11
|
+
editor: {
|
|
12
|
+
placeholder: "Odpovedzte alebo pridajte ostatných pomocou @",
|
|
13
|
+
reply: "Komentovať",
|
|
14
|
+
cancel: "Zrušiť",
|
|
15
|
+
save: "Uložiť"
|
|
16
|
+
},
|
|
17
|
+
item: {
|
|
18
|
+
edit: "Upraviť",
|
|
19
|
+
delete: "Odstrániť tento komentár"
|
|
20
|
+
},
|
|
21
|
+
filter: {
|
|
22
|
+
sheet: {
|
|
23
|
+
all: "Všetky hárky",
|
|
24
|
+
current: "Aktuálny hárok"
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
all: "Všetky komentáre",
|
|
28
|
+
resolved: "Vyriešené",
|
|
29
|
+
unsolved: "Nevyriešené",
|
|
30
|
+
concernMe: "Týka sa ma"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
e as default
|
|
37
|
+
};
|
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-left-0{left:0}.univer-right-0{right:0}.univer-top-0{top:0}.univer-m-0{margin:0}.univer-mb-1{margin-bottom:.25rem}.univer-mb-3{margin-bottom:.75rem}.univer-mb-4{margin-bottom:1rem}.univer-ml-1{margin-left:.25rem}.univer-mr-1\.5{margin-right:.375rem}.univer-mr-2{margin-right:.5rem}.univer-mt-2{margin-top:.5rem}.univer-mt-3{margin-top:.75rem}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-grid{display:grid}.univer-h-1\.5{height:.375rem}.univer-h-3\.5{height:.875rem}.univer-h-6{height:1.5rem}.univer-max-h-80{max-height:20rem}.univer-min-h-full{min-height:100%}.univer-w
|
|
1
|
+
.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-left-0{left:0}.univer-right-0{right:0}.univer-top-0{top:0}.univer-m-0{margin:0}.univer-mb-1{margin-bottom:.25rem}.univer-mb-3{margin-bottom:.75rem}.univer-mb-4{margin-bottom:1rem}.univer-ml-1{margin-left:.25rem}.univer-mr-1\.5{margin-right:.375rem}.univer-mr-2{margin-right:.5rem}.univer-mt-2{margin-top:.5rem}.univer-mt-3{margin-top:.75rem}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-grid{display:grid}.univer-size-6{width:1.5rem;height:1.5rem}.univer-h-1\.5{height:.375rem}.univer-h-3\.5{height:.875rem}.univer-h-6{height:1.5rem}.univer-max-h-80{max-height:20rem}.univer-min-h-full{min-height:100%}.univer-w-\[278px\]{width:278px}.univer-w-\[3px\]{width:3px}.univer-w-full{width:100%}.univer-flex-1{flex:1 1 0%}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow-0{flex-grow:0}.univer-cursor-pointer{cursor:pointer}.univer-list-none{list-style-type:none}.univer-flex-row{flex-direction:row}.univer-flex-col{flex-direction:column}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-2{gap:.5rem}.univer-gap-3{gap:.75rem}.univer-overflow-hidden{overflow:hidden}.univer-overflow-y-auto{overflow-y:auto}.univer-overflow-x-hidden{overflow-x:hidden}.univer-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.univer-break-words{word-wrap:break-word}.univer-rounded-\[3px\]{border-radius:3px}.univer-rounded-full{border-radius:9999px}.univer-rounded-lg{border-radius:.5rem}.univer-rounded-md{border-radius:.375rem}.univer-rounded-sm{border-radius:.125rem}.univer-rounded-t-md{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.\!univer-bg-gray-900{background-color:var(--univer-gray-900)!important}.univer-bg-gray-50{background-color:var(--univer-gray-50)}.univer-bg-white{background-color:var(--univer-white)}.univer-bg-yellow-400{background-color:var(--univer-yellow-400)}.univer-bg-yellow-500{background-color:var(--univer-yellow-500)}.univer-bg-cover{background-size:cover}.univer-bg-center{background-position:center}.univer-bg-no-repeat{background-repeat:no-repeat}.univer-p-1\.5{padding:.375rem}.univer-p-4{padding:1rem}.univer-pb-3{padding-bottom:.75rem}.univer-pl-\[30px\]{padding-left:30px}.univer-text-base{font-size:1rem;line-height:1.5rem}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-text-xs{font-size:.75rem;line-height:1rem}.univer-text-xs\/normal{font-size:.75rem;line-height:1.5}.univer-font-medium{font-weight:500}.univer-leading-5{line-height:1.25rem}.univer-text-gray-600{color:var(--univer-gray-600)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-green-500{color:var(--univer-green-500)}.univer-text-primary-600{color:var(--univer-primary-600)}.univer-shadow{--univer-tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--univer-tw-shadow-colored: 0 1px 3px 0 var(--univer-tw-shadow-color), 0 1px 2px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--univer-tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--univer-tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--univer-tw-shadow)}.hover\:univer-bg-gray-200:hover{background-color:var(--univer-gray-200)}.hover\:univer-bg-gray-50:hover{background-color:var(--univer-gray-50)}.dark\:\!univer-bg-gray-900:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)!important}.dark\:\!univer-text-gray-200:where(.univer-dark,.univer-dark *){color:var(--univer-gray-200)!important}.dark\:\!univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.dark\:hover\:\!univer-bg-gray-800:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)!important}.\[\&_a\]\:univer-block a{display:block}.\[\&_a\]\:univer-cursor-pointer a{cursor:pointer}.\[\&_a\]\:univer-rounded a{border-radius:.25rem}.\[\&_a\]\:univer-px-2 a{padding-left:.5rem;padding-right:.5rem}.\[\&_a\]\:univer-py-1\.5 a{padding-top:.375rem;padding-bottom:.375rem}.\[\&_a\]\:univer-transition-colors a{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}
|
package/lib/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var He = Object.defineProperty;
|
|
2
2
|
var Ve = (r, e, t) => e in r ? He(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var W = (r, e, t) => Ve(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { Inject as ye, IUniverInstanceService as je, Disposable as Pe, UniverInstanceType as de, CommandType as
|
|
5
|
-
import { ISidebarService as
|
|
4
|
+
import { Inject as ye, IUniverInstanceService as je, Disposable as Pe, UniverInstanceType as de, CommandType as _e, DependentOn as Ae, Injector as Be, ICommandService as te, IConfigService as We, Plugin as Ze, merge as Fe, mergeOverrideWithDependencies as ze, LocaleService as he, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ke, BuildTextUtils as ue, DOCS_COMMENT_EDITOR_UNIT_ID_KEY as Ge, Tools as Ye, CustomRangeType as qe, getBodySlice as Je, UserManagerService as fe, generateRandomId as Qe } from "@univerjs/core";
|
|
5
|
+
import { ISidebarService as we, useDependency as N, KeyCode as pe, useObservable as Z, useConfigValue as Xe, UI_PLUGIN_CONFIG_KEY as et } from "@univerjs/ui";
|
|
6
6
|
import { BehaviorSubject as Ce, filter as tt, debounceTime as rt } from "rxjs";
|
|
7
7
|
import { UniverThreadCommentPlugin as nt, ThreadCommentModel as Ne, getDT as it, AddCommentCommand as ot, ResolveCommentCommand as st, DeleteCommentTreeCommand as Se, UpdateCommentCommand as at, DeleteCommentCommand as lt } from "@univerjs/thread-comment";
|
|
8
8
|
import { jsxs as I, jsx as a } from "react/jsx-runtime";
|
|
9
9
|
import { Button as ae, clsx as ve, Tooltip as ct, scrollbarClassName as dt, borderClassName as ut, Dropdown as vt, Select as ge } from "@univerjs/design";
|
|
10
|
-
import { useRef as ee, createElement as
|
|
10
|
+
import { useRef as ee, createElement as z, forwardRef as K, useState as P, useEffect as le, useMemo as X, useImperativeHandle as mt } from "react";
|
|
11
11
|
import { IEditorService as ht, BreakLineCommand as ft, RichTextEditor as pt } from "@univerjs/docs-ui";
|
|
12
12
|
var Ct = Object.getOwnPropertyDescriptor, gt = (r, e, t, n) => {
|
|
13
13
|
for (var i = n > 1 ? void 0 : n ? Ct(e, t) : e, o = r.length - 1, c; o >= 0; o--)
|
|
@@ -52,14 +52,14 @@ let Y = class extends Pe {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
Y = gt([
|
|
55
|
-
Ie(0, ye(
|
|
55
|
+
Ie(0, ye(we)),
|
|
56
56
|
Ie(1, je)
|
|
57
57
|
], Y);
|
|
58
58
|
const It = "thread-comment-panel", xt = "UNIVER_THREAD_COMMENT_UI_PLUGIN", bt = {
|
|
59
59
|
id: "thread-comment-ui.operation.toggle-panel",
|
|
60
|
-
type:
|
|
60
|
+
type: _e.OPERATION,
|
|
61
61
|
handler(r) {
|
|
62
|
-
const e = r.get(
|
|
62
|
+
const e = r.get(we), t = r.get(Y);
|
|
63
63
|
return t.panelVisible ? (e.close(), t.setPanelVisible(!1)) : (e.open({
|
|
64
64
|
header: { title: "threadCommentUI.panel.title" },
|
|
65
65
|
children: { label: It },
|
|
@@ -68,13 +68,13 @@ const It = "thread-comment-panel", xt = "UNIVER_THREAD_COMMENT_UI_PLUGIN", bt =
|
|
|
68
68
|
}
|
|
69
69
|
}, F = {
|
|
70
70
|
id: "thread-comment-ui.operation.set-active-comment",
|
|
71
|
-
type:
|
|
71
|
+
type: _e.OPERATION,
|
|
72
72
|
handler(r, e) {
|
|
73
73
|
return r.get(Y).setActiveComment(e), !0;
|
|
74
74
|
}
|
|
75
75
|
}, yt = "thread-comment-ui.config", xe = {};
|
|
76
|
-
var
|
|
77
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
76
|
+
var _t = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, Nt = (r, e, t) => e in r ? _t(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, St = (r, e, t, n) => {
|
|
77
|
+
for (var i = n > 1 ? void 0 : n ? wt(e, t) : e, o = r.length - 1, c; o >= 0; o--)
|
|
78
78
|
(c = r[o]) && (i = c(i) || i);
|
|
79
79
|
return i;
|
|
80
80
|
}, me = (r, e) => (t, n) => e(t, n, r), $e = (r, e, t) => Nt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
@@ -90,7 +90,7 @@ let ce = class extends Ze {
|
|
|
90
90
|
}
|
|
91
91
|
onStarting() {
|
|
92
92
|
var r;
|
|
93
|
-
|
|
93
|
+
ze([
|
|
94
94
|
[Y]
|
|
95
95
|
], (r = this._config) == null ? void 0 : r.overrides).forEach((e) => {
|
|
96
96
|
this._injector.add(e);
|
|
@@ -107,7 +107,7 @@ ce = St([
|
|
|
107
107
|
me(2, te),
|
|
108
108
|
me(3, We)
|
|
109
109
|
], ce);
|
|
110
|
-
function
|
|
110
|
+
function G({ ref: r, ...e }) {
|
|
111
111
|
const { icon: t, id: n, className: i, extend: o, ...c } = e, x = `univerjs-icon univerjs-icon-${n} ${i || ""}`.trim(), h = ee(`_${kt()}`);
|
|
112
112
|
return Ue(t, `${n}`, {
|
|
113
113
|
defIds: t.defIds,
|
|
@@ -119,7 +119,7 @@ function z({ ref: r, ...e }) {
|
|
|
119
119
|
}, o);
|
|
120
120
|
}
|
|
121
121
|
function Ue(r, e, t, n, i) {
|
|
122
|
-
return
|
|
122
|
+
return z(r.tag, {
|
|
123
123
|
key: e,
|
|
124
124
|
...$t(r, t, i),
|
|
125
125
|
...n
|
|
@@ -152,7 +152,7 @@ function Ut(r, e) {
|
|
|
152
152
|
function kt() {
|
|
153
153
|
return Math.random().toString(36).substring(2, 8);
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
G.displayName = "UniverIcon";
|
|
156
156
|
const Tt = {
|
|
157
157
|
tag: "svg",
|
|
158
158
|
attrs: {
|
|
@@ -194,8 +194,8 @@ const Tt = {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
]
|
|
197
|
-
}, ke =
|
|
198
|
-
return
|
|
197
|
+
}, ke = K(function(e, t) {
|
|
198
|
+
return z(G, Object.assign({}, e, {
|
|
199
199
|
id: "delete-icon",
|
|
200
200
|
ref: t,
|
|
201
201
|
icon: Tt
|
|
@@ -218,8 +218,8 @@ const Dt = {
|
|
|
218
218
|
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"
|
|
219
219
|
}
|
|
220
220
|
}]
|
|
221
|
-
}, Te =
|
|
222
|
-
return
|
|
221
|
+
}, Te = K(function(e, t) {
|
|
222
|
+
return z(G, Object.assign({}, e, {
|
|
223
223
|
id: "increase-icon",
|
|
224
224
|
ref: t,
|
|
225
225
|
icon: Dt
|
|
@@ -258,8 +258,8 @@ const Et = {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
]
|
|
261
|
-
}, De =
|
|
262
|
-
return
|
|
261
|
+
}, De = K(function(e, t) {
|
|
262
|
+
return z(G, Object.assign({}, e, {
|
|
263
263
|
id: "more-horizontal-icon",
|
|
264
264
|
ref: t,
|
|
265
265
|
icon: Et
|
|
@@ -324,8 +324,8 @@ const Mt = {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
]
|
|
327
|
-
}, Ee =
|
|
328
|
-
return
|
|
327
|
+
}, Ee = K(function(e, t) {
|
|
328
|
+
return z(G, Object.assign({}, e, {
|
|
329
329
|
id: "reply-to-comment-icon",
|
|
330
330
|
ref: t,
|
|
331
331
|
icon: Mt
|
|
@@ -350,8 +350,8 @@ const Ot = {
|
|
|
350
350
|
clipRule: "evenodd"
|
|
351
351
|
}
|
|
352
352
|
}]
|
|
353
|
-
}, Me =
|
|
354
|
-
return
|
|
353
|
+
}, Me = K(function(e, t) {
|
|
354
|
+
return z(G, Object.assign({}, e, {
|
|
355
355
|
id: "resolved-icon",
|
|
356
356
|
ref: t,
|
|
357
357
|
icon: Ot
|
|
@@ -386,8 +386,8 @@ const Rt = {
|
|
|
386
386
|
strokeWidth: 1.2
|
|
387
387
|
}
|
|
388
388
|
}]
|
|
389
|
-
}, Oe =
|
|
390
|
-
return
|
|
389
|
+
}, Oe = K(function(e, t) {
|
|
390
|
+
return z(G, Object.assign({}, e, {
|
|
391
391
|
id: "solve-icon",
|
|
392
392
|
ref: t,
|
|
393
393
|
icon: Rt
|
|
@@ -401,18 +401,18 @@ function be(r) {
|
|
|
401
401
|
documentStyle: {}
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
|
-
const Re =
|
|
404
|
+
const Re = K((r, e) => {
|
|
405
405
|
var O;
|
|
406
|
-
const { comment: t, onSave: n, id: i, onCancel: o, autoFocus: c, unitId: x, type: h } = r, S = N(te), U = N(he), [V, k] = P(!1), b = N(ht), u = ee(null), v = h === de.UNIVER_DOC ?
|
|
406
|
+
const { comment: t, onSave: n, id: i, onCancel: o, autoFocus: c, unitId: x, type: h } = r, S = N(te), U = N(he), [V, k] = P(!1), b = N(ht), u = ee(null), v = h === de.UNIVER_DOC ? Ke : x, [T, y] = P(() => {
|
|
407
407
|
var d, m, f;
|
|
408
408
|
return ue.transform.getPlainText((f = (m = (d = u.current) == null ? void 0 : d.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? f : "");
|
|
409
409
|
});
|
|
410
410
|
le(() => {
|
|
411
|
-
var m, f,
|
|
412
|
-
y(ue.transform.getPlainText((
|
|
411
|
+
var m, f, _, p;
|
|
412
|
+
y(ue.transform.getPlainText((_ = (f = (m = u.current) == null ? void 0 : m.getDocumentData().body) == null ? void 0 : f.dataStream) != null ? _ : ""));
|
|
413
413
|
const d = (p = u.current) == null ? void 0 : p.selectionChange$.subscribe(() => {
|
|
414
|
-
var s,
|
|
415
|
-
y(ue.transform.getPlainText((A = (
|
|
414
|
+
var s, w, A;
|
|
415
|
+
y(ue.transform.getPlainText((A = (w = (s = u.current) == null ? void 0 : s.getDocumentData().body) == null ? void 0 : w.dataStream) != null ? A : ""));
|
|
416
416
|
});
|
|
417
417
|
return () => d == null ? void 0 : d.unsubscribe();
|
|
418
418
|
}, [(O = u.current) == null ? void 0 : O.selectionChange$]);
|
|
@@ -426,12 +426,12 @@ const Re = G((r, e) => {
|
|
|
426
426
|
}), [S]);
|
|
427
427
|
mt(e, () => ({
|
|
428
428
|
reply(d) {
|
|
429
|
-
var f,
|
|
429
|
+
var f, _;
|
|
430
430
|
if (!u.current)
|
|
431
431
|
return;
|
|
432
432
|
b.focus((f = u.current.getEditorId()) != null ? f : "");
|
|
433
433
|
const m = be(d);
|
|
434
|
-
(
|
|
434
|
+
(_ = u.current) == null || _.setDocumentData(m, [{
|
|
435
435
|
startOffset: m.body.dataStream.length - 2,
|
|
436
436
|
endOffset: m.body.dataStream.length - 2,
|
|
437
437
|
collapsed: !0
|
|
@@ -456,7 +456,7 @@ const Re = G((r, e) => {
|
|
|
456
456
|
{
|
|
457
457
|
className: "univer-w-full",
|
|
458
458
|
editorRef: u,
|
|
459
|
-
editorId:
|
|
459
|
+
editorId: Ge,
|
|
460
460
|
autoFocus: c,
|
|
461
461
|
keyboardEventConfig: j,
|
|
462
462
|
placeholder: U.t("threadCommentUI.editor.placeholder"),
|
|
@@ -575,7 +575,7 @@ const Re = G((r, e) => {
|
|
|
575
575
|
/* @__PURE__ */ a(
|
|
576
576
|
"div",
|
|
577
577
|
{
|
|
578
|
-
className: "univer-absolute univer-left-0 univer-top-0 univer-
|
|
578
|
+
className: "univer-absolute univer-left-0 univer-top-0 univer-size-6 univer-rounded-full univer-bg-cover univer-bg-center univer-bg-no-repeat",
|
|
579
579
|
style: {
|
|
580
580
|
backgroundImage: `url(${(v == null ? void 0 : v.avatar) || m})`
|
|
581
581
|
}
|
|
@@ -587,7 +587,7 @@ const Re = G((r, e) => {
|
|
|
587
587
|
j || x ? null : C && v ? /* @__PURE__ */ a(
|
|
588
588
|
"div",
|
|
589
589
|
{
|
|
590
|
-
className: "univer-ml-1 univer-inline-flex univer-
|
|
590
|
+
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",
|
|
591
591
|
onClick: () => c(v),
|
|
592
592
|
children: /* @__PURE__ */ a(Ee, {})
|
|
593
593
|
}
|
|
@@ -622,7 +622,7 @@ const Re = G((r, e) => {
|
|
|
622
622
|
children: /* @__PURE__ */ a(
|
|
623
623
|
"div",
|
|
624
624
|
{
|
|
625
|
-
className: "univer-ml-1 univer-inline-flex univer-
|
|
625
|
+
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",
|
|
626
626
|
children: /* @__PURE__ */ a(De, {})
|
|
627
627
|
}
|
|
628
628
|
)
|
|
@@ -647,7 +647,7 @@ const Re = G((r, e) => {
|
|
|
647
647
|
autoFocus: !0,
|
|
648
648
|
unitId: t,
|
|
649
649
|
subUnitId: n,
|
|
650
|
-
onSave: ({ text:
|
|
650
|
+
onSave: ({ text: _, attachments: p }) => {
|
|
651
651
|
o == null || o(!1), k.executeCommand(
|
|
652
652
|
at.id,
|
|
653
653
|
{
|
|
@@ -655,7 +655,7 @@ const Re = G((r, e) => {
|
|
|
655
655
|
subUnitId: n,
|
|
656
656
|
payload: {
|
|
657
657
|
commentId: e.id,
|
|
658
|
-
text:
|
|
658
|
+
text: _,
|
|
659
659
|
attachments: p
|
|
660
660
|
}
|
|
661
661
|
}
|
|
@@ -666,10 +666,10 @@ const Re = G((r, e) => {
|
|
|
666
666
|
"div",
|
|
667
667
|
{
|
|
668
668
|
className: "univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
669
|
-
children: Ht(e.text).map((
|
|
669
|
+
children: Ht(e.text).map((_, p) => /* @__PURE__ */ a("div", { className: "univer-break-words", children: _.map((s, w) => s.type === "mention" ? /* @__PURE__ */ I("a", { className: "univer-text-primary-600", children: [
|
|
670
670
|
s.content.label,
|
|
671
671
|
" "
|
|
672
|
-
] },
|
|
672
|
+
] }, w) : s.content) }, p))
|
|
673
673
|
}
|
|
674
674
|
)
|
|
675
675
|
] });
|
|
@@ -695,9 +695,9 @@ const Re = G((r, e) => {
|
|
|
695
695
|
type: y,
|
|
696
696
|
style: j,
|
|
697
697
|
full: C
|
|
698
|
-
} = r, O = N(Ne), [d, m] = P(!1), [f,
|
|
698
|
+
} = r, O = N(Ne), [d, m] = P(!1), [f, _] = P(""), p = X(() => O.commentUpdate$.pipe(rt(16)), [O]);
|
|
699
699
|
Z(p);
|
|
700
|
-
const s = e ? O.getCommentWithChildren(t, n, e) : null,
|
|
700
|
+
const s = e ? O.getCommentWithChildren(t, n, e) : null, w = N(te), A = N(fe), D = s == null ? void 0 : s.root.resolved, E = Z(A.currentUser$), L = ee(null), q = [
|
|
701
701
|
...s ? [s.root] : (
|
|
702
702
|
// mock empty comment
|
|
703
703
|
[{
|
|
@@ -716,18 +716,18 @@ const Re = G((r, e) => {
|
|
|
716
716
|
),
|
|
717
717
|
...(Q = s == null ? void 0 : s.children) != null ? Q : []
|
|
718
718
|
], R = ee(null), re = (g) => {
|
|
719
|
-
g.stopPropagation(), D ?
|
|
719
|
+
g.stopPropagation(), D ? w.executeCommand(F.id, {
|
|
720
720
|
unitId: t,
|
|
721
721
|
subUnitId: n,
|
|
722
722
|
commentId: e
|
|
723
|
-
}) :
|
|
723
|
+
}) : w.executeCommand(F.id), w.executeCommand(st.id, {
|
|
724
724
|
unitId: t,
|
|
725
725
|
subUnitId: n,
|
|
726
726
|
commentId: e,
|
|
727
727
|
resolved: !D
|
|
728
728
|
}), T == null || T(!D);
|
|
729
729
|
}, J = (g) => {
|
|
730
|
-
g.stopPropagation(),
|
|
730
|
+
g.stopPropagation(), w.executeCommand(F.id), !(s != null && s.root && (v == null ? void 0 : v(s.root)) === !1) && (w.executeCommand(
|
|
731
731
|
Se.id,
|
|
732
732
|
{
|
|
733
733
|
unitId: t,
|
|
@@ -786,7 +786,7 @@ const Re = G((r, e) => {
|
|
|
786
786
|
/* @__PURE__ */ a(
|
|
787
787
|
"div",
|
|
788
788
|
{
|
|
789
|
-
className: ve("univer-ml-1 univer-inline-flex univer-
|
|
789
|
+
className: ve("univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800", {
|
|
790
790
|
"univer-text-green-500": D
|
|
791
791
|
}),
|
|
792
792
|
onClick: re,
|
|
@@ -796,7 +796,7 @@ const Re = G((r, e) => {
|
|
|
796
796
|
(E == null ? void 0 : E.userID) === s.root.personId ? /* @__PURE__ */ a(
|
|
797
797
|
"div",
|
|
798
798
|
{
|
|
799
|
-
className: "univer-ml-1 univer-inline-flex univer-
|
|
799
|
+
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800",
|
|
800
800
|
onClick: J,
|
|
801
801
|
children: /* @__PURE__ */ a(ke, {})
|
|
802
802
|
}
|
|
@@ -823,7 +823,7 @@ const Re = G((r, e) => {
|
|
|
823
823
|
type: y,
|
|
824
824
|
onClose: h,
|
|
825
825
|
onEditingChange: (M) => {
|
|
826
|
-
|
|
826
|
+
_(M ? g.id : "");
|
|
827
827
|
},
|
|
828
828
|
onReply: (M) => {
|
|
829
829
|
M && requestAnimationFrame(() => {
|
|
@@ -871,7 +871,7 @@ const Re = G((r, e) => {
|
|
|
871
871
|
subUnitId: n,
|
|
872
872
|
threadId: s == null ? void 0 : s.root.threadId
|
|
873
873
|
};
|
|
874
|
-
(u == null ? void 0 : u(H)) !== !1 && (await
|
|
874
|
+
(u == null ? void 0 : u(H)) !== !1 && (await w.executeCommand(
|
|
875
875
|
ot.id,
|
|
876
876
|
{
|
|
877
877
|
unitId: t,
|
|
@@ -906,7 +906,7 @@ const Re = G((r, e) => {
|
|
|
906
906
|
onAddComment: k,
|
|
907
907
|
onDeleteComment: b,
|
|
908
908
|
showComments: u
|
|
909
|
-
} = r, [v, T] = P("all"), [y, j] = P("all"), C = N(he), O = N(fe), d = N(Ne), [m, f] = P(() => d.getUnit(e)),
|
|
909
|
+
} = r, [v, T] = P("all"), [y, j] = P("all"), C = N(he), O = N(fe), d = N(Ne), [m, f] = P(() => d.getUnit(e)), _ = N(Y), p = Z(_.activeCommentId$), s = Z(d.commentUpdate$), w = N(te), A = Z(t), D = ee(!0), E = "panel", L = Z(O.currentUser$), q = X(() => {
|
|
910
910
|
var H;
|
|
911
911
|
const l = v === "all" ? m : (H = m.filter(($) => $.subUnitId === A)) != null ? H : [], g = x != null ? x : (($) => $), M = l.map(($) => {
|
|
912
912
|
var B;
|
|
@@ -953,7 +953,7 @@ const Re = G((r, e) => {
|
|
|
953
953
|
showEdit: (p == null ? void 0 : p.commentId) === l.id,
|
|
954
954
|
showHighlight: (p == null ? void 0 : p.commentId) === l.id,
|
|
955
955
|
onClick: () => {
|
|
956
|
-
D.current = !1, l.resolved ?
|
|
956
|
+
D.current = !1, l.resolved ? w.executeCommand(F.id) : w.executeCommand(
|
|
957
957
|
F.id,
|
|
958
958
|
{
|
|
959
959
|
unitId: l.unitId,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
threadCommentUI: {
|
|
3
|
+
panel: {
|
|
4
|
+
title: "Správa komentárov",
|
|
5
|
+
empty: "Zatiaľ žiadne komentáre",
|
|
6
|
+
filterEmpty: "Žiadne zodpovedajúce výsledky",
|
|
7
|
+
reset: "Obnoviť filter",
|
|
8
|
+
addComment: "Pridať komentár",
|
|
9
|
+
solved: "Vyriešené"
|
|
10
|
+
},
|
|
11
|
+
editor: {
|
|
12
|
+
placeholder: "Odpovedzte alebo pridajte ostatných pomocou @",
|
|
13
|
+
reply: "Komentovať",
|
|
14
|
+
cancel: "Zrušiť",
|
|
15
|
+
save: "Uložiť"
|
|
16
|
+
},
|
|
17
|
+
item: {
|
|
18
|
+
edit: "Upraviť",
|
|
19
|
+
delete: "Odstrániť tento komentár"
|
|
20
|
+
},
|
|
21
|
+
filter: {
|
|
22
|
+
sheet: {
|
|
23
|
+
all: "Všetky hárky",
|
|
24
|
+
current: "Aktuálny hárok"
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
all: "Všetky komentáre",
|
|
28
|
+
resolved: "Vyriešené",
|
|
29
|
+
unsolved: "Nevyriešené",
|
|
30
|
+
concernMe: "Týka sa ma"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
e as default
|
|
37
|
+
};
|
package/lib/umd/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(u,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/thread-comment"),require("react/jsx-runtime"),require("@univerjs/design"),require("react"),require("@univerjs/docs-ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/ui","rxjs","@univerjs/thread-comment","react/jsx-runtime","@univerjs/design","react","@univerjs/docs-ui"],s):(u=typeof globalThis<"u"?globalThis:u||self,s(u.UniverThreadCommentUi={},u.UniverCore,u.UniverUi,u.rxjs,u.UniverThreadComment,u.React,u.UniverDesign,u.React,u.UniverDocsUi))})(this,(function(u,s,m,Q,V,i,U,d,ie){"use strict";var Fe=Object.defineProperty;var qe=(u,s,m)=>s in u?Fe(u,s,{enumerable:!0,configurable:!0,writable:!0,value:m}):u[s]=m;var z=(u,s,m)=>qe(u,typeof s!="symbol"?s+"":s,m);var ye=Object.getOwnPropertyDescriptor,Se=(r,e,t,n)=>{for(var o=n>1?void 0:n?ye(e,t):e,a=r.length-1,v;a>=0;a--)(v=r[a])&&(o=v(o)||o);return o},oe=(r,e)=>(t,n)=>e(t,n,r);u.ThreadCommentPanelService=class extends s.Disposable{constructor(t,n){super();z(this,"_panelVisible",!1);z(this,"_panelVisible$",new Q.BehaviorSubject(!1));z(this,"_activeCommentId");z(this,"_activeCommentId$",new Q.BehaviorSubject(void 0));z(this,"panelVisible$",this._panelVisible$.asObservable());z(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=n,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(s.UniverInstanceType.UNIVER_SHEET).pipe(Q.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},u.ThreadCommentPanelService=Se([oe(0,s.Inject(m.ISidebarService)),oe(1,s.IUniverInstanceService)],u.ThreadCommentPanelService);const ae="thread-comment-panel",we="UNIVER_THREAD_COMMENT_UI_PLUGIN",le={id:"thread-comment-ui.operation.toggle-panel",type:s.CommandType.OPERATION,handler(r){const e=r.get(m.ISidebarService),t=r.get(u.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:ae},width:360}),t.setPanelVisible(!0)),!0}},F={id:"thread-comment-ui.operation.set-active-comment",type:s.CommandType.OPERATION,handler(r,e){return r.get(u.ThreadCommentPanelService).setActiveComment(e),!0}},_e="thread-comment-ui.config",de={};var Te=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ue=(r,e,t)=>e in r?Te(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,De=(r,e,t,n)=>{for(var o=n>1?void 0:n?Ne(e,t):e,a=r.length-1,v;a>=0;a--)(v=r[a])&&(o=v(o)||o);return o},se=(r,e)=>(t,n)=>e(t,n,r),ce=(r,e,t)=>Ue(r,typeof e!="symbol"?e+"":e,t);u.UniverThreadCommentUIPlugin=class extends s.Plugin{constructor(e=de,t,n,o){super(),this._config=e,this._injector=t,this._commandService=n,this._configService=o;const{menu:a,...v}=s.merge({},de,this._config);a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(_e,v)}onStarting(){var e;s.mergeOverrideWithDependencies([[u.ThreadCommentPanelService]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[le,F].forEach(t=>{this._commandService.registerCommand(t)})}},ce(u.UniverThreadCommentUIPlugin,"pluginName",we),ce(u.UniverThreadCommentUIPlugin,"type",s.UniverInstanceType.UNIVER_UNKNOWN),u.UniverThreadCommentUIPlugin=De([s.DependentOn(V.UniverThreadCommentPlugin),se(1,s.Inject(s.Injector)),se(2,s.ICommandService),se(3,s.IConfigService)],u.UniverThreadCommentUIPlugin);function q({ref:r,...e}){const{icon:t,id:n,className:o,extend:a,...v}=e,S=`univerjs-icon univerjs-icon-${n} ${o||""}`.trim(),g=d.useRef(`_${ke()}`);return ue(t,`${n}`,{defIds:t.defIds,idSuffix:g.current},{ref:r,className:S,...v},a)}function ue(r,e,t,n,o){return d.createElement(r.tag,{key:e,...Ee(r,t,o),...n},($e(r,t).children||[]).map((a,v)=>ue(a,`${e}-${r.tag}-${v}`,t,void 0,o)))}function Ee(r,e,t){const n={...r.attrs};t!=null&&t.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=t.colorChannel1),r.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(([a,v])=>{a==="mask"&&typeof v=="string"&&(n[a]=v.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))});const{defIds:o}=e;return!o||o.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(([a,v])=>{typeof v=="string"&&(n[a]=v.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))})),n}function $e(r,e){var n;const{defIds:t}=e;return!t||t.length===0?r:r.tag==="defs"&&((n=r.children)!=null&&n.length)?{...r,children:r.children.map(o=>typeof o.attrs.id=="string"&&t&&t.includes(o.attrs.id)?{...o,attrs:{...o.attrs,id:o.attrs.id+e.idSuffix}}:o)}:r}function ke(){return Math.random().toString(36).substring(2,8)}q.displayName="UniverIcon";const Me={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:"M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ve=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"delete-icon",ref:t,icon:Me}))});ve.displayName="DeleteIcon";const Oe={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"}}]},me=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"increase-icon",ref:t,icon:Oe}))});me.displayName="IncreaseIcon";const 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:"M3 9C3.55228 9 4 8.55228 4 8C4 7.44772 3.55228 7 3 7C2.44772 7 2 7.44772 2 8C2 8.55228 2.44772 9 3 9Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M13 9C13.5523 9 14 8.55228 14 8C14 7.44772 13.5523 7 13 7C12.4477 7 12 7.44772 12 8C12 8.55228 12.4477 9 13 9Z"}}]},he=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"more-horizontal-icon",ref:t,icon:je}))});he.displayName="MoreHorizontalIcon";const Pe={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:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813",strokeLinecap:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M8.91626 6.1311H9.27424",strokeLinecap:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},fe=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"reply-to-comment-icon",ref:t,icon:Pe}))});fe.displayName="ReplyToCommentIcon";const Le={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},pe=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"resolved-icon",ref:t,icon:Le}))});pe.displayName="ResolvedIcon";const He={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Ce=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"solve-icon",ref:t,icon:He}))});Ce.displayName="SolveIcon";function ge(r){return{id:"d",body:r,documentStyle:{}}}const Ie=d.forwardRef((r,e)=>{var L;const{comment:t,onSave:n,id:o,onCancel:a,autoFocus:v,unitId:S,type:g}=r,D=m.useDependency(s.ICommandService),$=m.useDependency(s.LocaleService),[W,k]=d.useState(!1),w=m.useDependency(ie.IEditorService),f=d.useRef(null),p=g===s.UniverInstanceType.UNIVER_DOC?s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY:S,[M,_]=d.useState(()=>{var h,C,I;return s.BuildTextUtils.transform.getPlainText((I=(C=(h=f.current)==null?void 0:h.getDocumentData().body)==null?void 0:C.dataStream)!=null?I:"")});d.useEffect(()=>{var C,I,T,b;_(s.BuildTextUtils.transform.getPlainText((T=(I=(C=f.current)==null?void 0:C.getDocumentData().body)==null?void 0:I.dataStream)!=null?T:""));const h=(b=f.current)==null?void 0:b.selectionChange$.subscribe(()=>{var l,N,K;_(s.BuildTextUtils.transform.getPlainText((K=(N=(l=f.current)==null?void 0:l.getDocumentData().body)==null?void 0:N.dataStream)!=null?K:""))});return()=>h==null?void 0:h.unsubscribe()},[(L=f.current)==null?void 0:L.selectionChange$]);const Z=d.useMemo(()=>({keyCodes:[{keyCode:m.KeyCode.ENTER}],handler:h=>{h===m.KeyCode.ENTER&&D.executeCommand(ie.BreakLineCommand.id)}}),[D]);d.useImperativeHandle(e,()=>({reply(h){var I,T;if(!f.current)return;w.focus((I=f.current.getEditorId())!=null?I:"");const C=ge(h);(T=f.current)==null||T.setDocumentData(C,[{startOffset:C.body.dataStream.length-2,endOffset:C.body.dataStream.length-2,collapsed:!0}])}}));const x=()=>{if(f.current){const h=s.Tools.deepClone(f.current.getDocumentData().body);k(!1),n==null||n({...t,text:h}),f.current.replaceText(""),setTimeout(()=>{var C,I;(C=f.current)==null||C.setSelectionRanges([]),(I=f.current)==null||I.blur()},10)}};return i.jsxs("div",{onClick:h=>h.preventDefault(),children:[i.jsx(ie.RichTextEditor,{className:"univer-w-full",editorRef:f,editorId:s.DOCS_COMMENT_EDITOR_UNIT_ID_KEY,autoFocus:v,keyboardEventConfig:Z,placeholder:$.t("threadCommentUI.editor.placeholder"),initialValue:(t==null?void 0:t.text)&&ge(t.text),onFocusChange:h=>h&&k(h),isSingle:!1,maxHeight:64,onClickOutside:()=>{setTimeout(()=>{w.focus(p)},30)}}),W?i.jsxs("div",{className:"univer-mt-3 univer-flex univer-flex-row univer-justify-end univer-gap-2",children:[i.jsx(U.Button,{onClick:()=>{var h;a==null||a(),k(!1),(h=f.current)==null||h.replaceText("",!0),D.executeCommand(F.id)},children:$.t("threadCommentUI.editor.cancel")}),i.jsx(U.Button,{variant:"primary",disabled:!M,onClick:x,children:$.t(o?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),Ve=r=>{const{dataStream:e,customRanges:t}=r,n=e.endsWith(`\r
|
|
1
|
+
(function(u,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/thread-comment"),require("react/jsx-runtime"),require("@univerjs/design"),require("react"),require("@univerjs/docs-ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/ui","rxjs","@univerjs/thread-comment","react/jsx-runtime","@univerjs/design","react","@univerjs/docs-ui"],s):(u=typeof globalThis<"u"?globalThis:u||self,s(u.UniverThreadCommentUi={},u.UniverCore,u.UniverUi,u.rxjs,u.UniverThreadComment,u.React,u.UniverDesign,u.React,u.UniverDocsUi))})(this,(function(u,s,m,Q,V,i,U,d,ie){"use strict";var Fe=Object.defineProperty;var qe=(u,s,m)=>s in u?Fe(u,s,{enumerable:!0,configurable:!0,writable:!0,value:m}):u[s]=m;var G=(u,s,m)=>qe(u,typeof s!="symbol"?s+"":s,m);var ye=Object.getOwnPropertyDescriptor,Se=(r,e,t,n)=>{for(var o=n>1?void 0:n?ye(e,t):e,a=r.length-1,v;a>=0;a--)(v=r[a])&&(o=v(o)||o);return o},oe=(r,e)=>(t,n)=>e(t,n,r);u.ThreadCommentPanelService=class extends s.Disposable{constructor(t,n){super();G(this,"_panelVisible",!1);G(this,"_panelVisible$",new Q.BehaviorSubject(!1));G(this,"_activeCommentId");G(this,"_activeCommentId$",new Q.BehaviorSubject(void 0));G(this,"panelVisible$",this._panelVisible$.asObservable());G(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=n,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(s.UniverInstanceType.UNIVER_SHEET).pipe(Q.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},u.ThreadCommentPanelService=Se([oe(0,s.Inject(m.ISidebarService)),oe(1,s.IUniverInstanceService)],u.ThreadCommentPanelService);const ae="thread-comment-panel",_e="UNIVER_THREAD_COMMENT_UI_PLUGIN",le={id:"thread-comment-ui.operation.toggle-panel",type:s.CommandType.OPERATION,handler(r){const e=r.get(m.ISidebarService),t=r.get(u.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:ae},width:360}),t.setPanelVisible(!0)),!0}},F={id:"thread-comment-ui.operation.set-active-comment",type:s.CommandType.OPERATION,handler(r,e){return r.get(u.ThreadCommentPanelService).setActiveComment(e),!0}},we="thread-comment-ui.config",de={};var Te=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ue=(r,e,t)=>e in r?Te(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,De=(r,e,t,n)=>{for(var o=n>1?void 0:n?Ne(e,t):e,a=r.length-1,v;a>=0;a--)(v=r[a])&&(o=v(o)||o);return o},se=(r,e)=>(t,n)=>e(t,n,r),ce=(r,e,t)=>Ue(r,typeof e!="symbol"?e+"":e,t);u.UniverThreadCommentUIPlugin=class extends s.Plugin{constructor(e=de,t,n,o){super(),this._config=e,this._injector=t,this._commandService=n,this._configService=o;const{menu:a,...v}=s.merge({},de,this._config);a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(we,v)}onStarting(){var e;s.mergeOverrideWithDependencies([[u.ThreadCommentPanelService]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[le,F].forEach(t=>{this._commandService.registerCommand(t)})}},ce(u.UniverThreadCommentUIPlugin,"pluginName",_e),ce(u.UniverThreadCommentUIPlugin,"type",s.UniverInstanceType.UNIVER_UNKNOWN),u.UniverThreadCommentUIPlugin=De([s.DependentOn(V.UniverThreadCommentPlugin),se(1,s.Inject(s.Injector)),se(2,s.ICommandService),se(3,s.IConfigService)],u.UniverThreadCommentUIPlugin);function q({ref:r,...e}){const{icon:t,id:n,className:o,extend:a,...v}=e,S=`univerjs-icon univerjs-icon-${n} ${o||""}`.trim(),g=d.useRef(`_${ke()}`);return ue(t,`${n}`,{defIds:t.defIds,idSuffix:g.current},{ref:r,className:S,...v},a)}function ue(r,e,t,n,o){return d.createElement(r.tag,{key:e,...Ee(r,t,o),...n},($e(r,t).children||[]).map((a,v)=>ue(a,`${e}-${r.tag}-${v}`,t,void 0,o)))}function Ee(r,e,t){const n={...r.attrs};t!=null&&t.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=t.colorChannel1),r.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(([a,v])=>{a==="mask"&&typeof v=="string"&&(n[a]=v.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))});const{defIds:o}=e;return!o||o.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(([a,v])=>{typeof v=="string"&&(n[a]=v.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))})),n}function $e(r,e){var n;const{defIds:t}=e;return!t||t.length===0?r:r.tag==="defs"&&((n=r.children)!=null&&n.length)?{...r,children:r.children.map(o=>typeof o.attrs.id=="string"&&t&&t.includes(o.attrs.id)?{...o,attrs:{...o.attrs,id:o.attrs.id+e.idSuffix}}:o)}:r}function ke(){return Math.random().toString(36).substring(2,8)}q.displayName="UniverIcon";const Me={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:"M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ve=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"delete-icon",ref:t,icon:Me}))});ve.displayName="DeleteIcon";const Oe={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"}}]},me=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"increase-icon",ref:t,icon:Oe}))});me.displayName="IncreaseIcon";const 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:"M3 9C3.55228 9 4 8.55228 4 8C4 7.44772 3.55228 7 3 7C2.44772 7 2 7.44772 2 8C2 8.55228 2.44772 9 3 9Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M13 9C13.5523 9 14 8.55228 14 8C14 7.44772 13.5523 7 13 7C12.4477 7 12 7.44772 12 8C12 8.55228 12.4477 9 13 9Z"}}]},he=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"more-horizontal-icon",ref:t,icon:je}))});he.displayName="MoreHorizontalIcon";const Pe={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:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813",strokeLinecap:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M8.91626 6.1311H9.27424",strokeLinecap:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},fe=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"reply-to-comment-icon",ref:t,icon:Pe}))});fe.displayName="ReplyToCommentIcon";const Le={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},pe=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"resolved-icon",ref:t,icon:Le}))});pe.displayName="ResolvedIcon";const He={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Ce=d.forwardRef(function(e,t){return d.createElement(q,Object.assign({},e,{id:"solve-icon",ref:t,icon:He}))});Ce.displayName="SolveIcon";function ge(r){return{id:"d",body:r,documentStyle:{}}}const Ie=d.forwardRef((r,e)=>{var L;const{comment:t,onSave:n,id:o,onCancel:a,autoFocus:v,unitId:S,type:g}=r,D=m.useDependency(s.ICommandService),$=m.useDependency(s.LocaleService),[W,k]=d.useState(!1),_=m.useDependency(ie.IEditorService),f=d.useRef(null),p=g===s.UniverInstanceType.UNIVER_DOC?s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY:S,[M,w]=d.useState(()=>{var h,C,I;return s.BuildTextUtils.transform.getPlainText((I=(C=(h=f.current)==null?void 0:h.getDocumentData().body)==null?void 0:C.dataStream)!=null?I:"")});d.useEffect(()=>{var C,I,T,b;w(s.BuildTextUtils.transform.getPlainText((T=(I=(C=f.current)==null?void 0:C.getDocumentData().body)==null?void 0:I.dataStream)!=null?T:""));const h=(b=f.current)==null?void 0:b.selectionChange$.subscribe(()=>{var l,N,z;w(s.BuildTextUtils.transform.getPlainText((z=(N=(l=f.current)==null?void 0:l.getDocumentData().body)==null?void 0:N.dataStream)!=null?z:""))});return()=>h==null?void 0:h.unsubscribe()},[(L=f.current)==null?void 0:L.selectionChange$]);const Z=d.useMemo(()=>({keyCodes:[{keyCode:m.KeyCode.ENTER}],handler:h=>{h===m.KeyCode.ENTER&&D.executeCommand(ie.BreakLineCommand.id)}}),[D]);d.useImperativeHandle(e,()=>({reply(h){var I,T;if(!f.current)return;_.focus((I=f.current.getEditorId())!=null?I:"");const C=ge(h);(T=f.current)==null||T.setDocumentData(C,[{startOffset:C.body.dataStream.length-2,endOffset:C.body.dataStream.length-2,collapsed:!0}])}}));const x=()=>{if(f.current){const h=s.Tools.deepClone(f.current.getDocumentData().body);k(!1),n==null||n({...t,text:h}),f.current.replaceText(""),setTimeout(()=>{var C,I;(C=f.current)==null||C.setSelectionRanges([]),(I=f.current)==null||I.blur()},10)}};return i.jsxs("div",{onClick:h=>h.preventDefault(),children:[i.jsx(ie.RichTextEditor,{className:"univer-w-full",editorRef:f,editorId:s.DOCS_COMMENT_EDITOR_UNIT_ID_KEY,autoFocus:v,keyboardEventConfig:Z,placeholder:$.t("threadCommentUI.editor.placeholder"),initialValue:(t==null?void 0:t.text)&&ge(t.text),onFocusChange:h=>h&&k(h),isSingle:!1,maxHeight:64,onClickOutside:()=>{setTimeout(()=>{_.focus(p)},30)}}),W?i.jsxs("div",{className:"univer-mt-3 univer-flex univer-flex-row univer-justify-end univer-gap-2",children:[i.jsx(U.Button,{onClick:()=>{var h;a==null||a(),k(!1),(h=f.current)==null||h.replaceText("",!0),D.executeCommand(F.id)},children:$.t("threadCommentUI.editor.cancel")}),i.jsx(U.Button,{variant:"primary",disabled:!M,onClick:x,children:$.t(o?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),Ve=r=>{const{dataStream:e,customRanges:t}=r,n=e.endsWith(`\r
|
|
2
2
|
`)?e.length-2:e.length,o=[];let a=0;return t==null||t.forEach(v=>{a<v.startIndex&&o.push({type:"text",content:e.slice(a,v.startIndex)}),o.push({type:"mention",content:{label:e.slice(v.startIndex,v.endIndex+1),id:v.rangeId}}),a=v.endIndex+1}),o.push({type:"text",content:e.slice(a,n)}),o},Be=r=>{if(!r)return[];const{paragraphs:e=[]}=r;return e.map((t,n)=>{const o=n===0?0:e[n-1].startIndex+1,a=s.getBodySlice(r,o,t.startIndex);return Ve(a)})},Ae=r=>{let e="";const t=[];return r.forEach(n=>{switch(n.type){case"text":e+=n.content;break;case"mention":{const o=e.length;e+=n.content.label;const a=e.length-1;t.push({rangeId:n.content.id,rangeType:s.CustomRangeType.MENTION,startIndex:o,endIndex:a,properties:{},wholeEntity:!0});break}}}),e+=`\r
|
|
3
|
-
`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},be="__mock__",We=r=>{const{item:e,unitId:t,subUnitId:n,editing:o,onEditingChange:a,onReply:v,resolved:S,isRoot:g,onClose:D,onDeleteComment:$,type:W}=r,k=m.useDependency(s.ICommandService),
|
|
4
|
-
\r`},personId:(re=j==null?void 0:j.userID)!=null?re:"",ref:o!=null?o:"",dT:"",unitId:t,subUnitId:n,threadId:""}],...(J=l==null?void 0:l.children)!=null?J:[]],H=d.useRef(null),X=y=>{y.stopPropagation(),O?N.executeCommand(F.id,{unitId:t,subUnitId:n,commentId:e}):N.executeCommand(F.id),N.executeCommand(V.ResolveCommentCommand.id,{unitId:t,subUnitId:n,commentId:e,resolved:!O}),M==null||M(!O)},R=y=>{y.stopPropagation(),N.executeCommand(F.id),!(l!=null&&l.root&&(p==null?void 0:p(l.root))===!1)&&(N.executeCommand(V.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:n,commentId:e}),g==null||g())};d.useEffect(()=>
|
|
3
|
+
`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},be="__mock__",We=r=>{const{item:e,unitId:t,subUnitId:n,editing:o,onEditingChange:a,onReply:v,resolved:S,isRoot:g,onClose:D,onDeleteComment:$,type:W}=r,k=m.useDependency(s.ICommandService),_=m.useDependency(s.LocaleService),f=m.useDependency(s.UserManagerService),p=f.getUser(e.personId),M=m.useObservable(f.currentUser$),w=(M==null?void 0:M.userID)===e.personId,Z=e.id===be,[x,L]=d.useState(!1),h=m.useConfigValue(m.UI_PLUGIN_CONFIG_KEY),C=h==null?void 0:h.avatarFallback,I=()=>{($==null?void 0:$(e))!==!1&&(k.executeCommand(g?V.DeleteCommentTreeCommand.id:V.DeleteCommentCommand.id,{unitId:t,subUnitId:n,commentId:e.id}),g&&(D==null||D()))};return i.jsxs("div",{className:"univer-relative univer-mb-3 univer-pl-[30px]",onMouseLeave:()=>L(!1),onMouseEnter:()=>L(!0),children:[i.jsx("div",{className:"univer-absolute univer-left-0 univer-top-0 univer-size-6 univer-rounded-full univer-bg-cover univer-bg-center univer-bg-no-repeat",style:{backgroundImage:`url(${(p==null?void 0:p.avatar)||C})`}}),p?i.jsxs("div",{className:"univer-mb-1 univer-flex univer-h-6 univer-items-center univer-justify-between",children:[i.jsx("div",{className:"univer-text-sm univer-font-medium univer-leading-5",children:(p==null?void 0:p.name)||" "}),i.jsxs("div",{children:[Z||S?null:x&&p?i.jsx("div",{className:"univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",onClick:()=>v(p),children:i.jsx(fe,{})}):null,w&&!Z&&!S?i.jsx(U.Dropdown,{overlay:i.jsx("div",{className:"univer-rounded-lg",children:i.jsxs("ul",{className:"univer-m-0 univer-box-border univer-grid univer-list-none univer-p-1.5 univer-text-sm [&_a]:univer-block [&_a]:univer-cursor-pointer [&_a]:univer-rounded [&_a]:univer-px-2 [&_a]:univer-py-1.5 [&_a]:univer-transition-colors",children:[i.jsx("li",{children:i.jsx("a",{className:"hover:univer-bg-gray-200",onClick:()=>a==null?void 0:a(!0),children:_.t("threadCommentUI.item.edit")})}),i.jsx("li",{children:i.jsx("a",{className:"hover:univer-bg-gray-200",onClick:I,children:_.t("threadCommentUI.item.delete")})})]})}),children:i.jsx("div",{className:"univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",children:i.jsx(he,{})})}):null]})]}):null,i.jsx("time",{className:"univer-mb-1 univer-text-xs/normal univer-text-gray-600 dark:!univer-text-gray-200",children:e.dT}),o?i.jsx(Ie,{type:W,id:e.id,comment:e,onCancel:()=>a==null?void 0:a(!1),autoFocus:!0,unitId:t,subUnitId:n,onSave:({text:T,attachments:b})=>{a==null||a(!1),k.executeCommand(V.UpdateCommentCommand.id,{unitId:t,subUnitId:n,payload:{commentId:e.id,text:T,attachments:b}})}}):i.jsx("div",{className:"univer-text-sm univer-text-gray-900 dark:!univer-text-white",children:Be(e.text).map((T,b)=>i.jsx("div",{className:"univer-break-words",children:T.map((l,N)=>l.type==="mention"?i.jsxs("a",{className:"univer-text-primary-600",children:[l.content.label," "]},N):l.content)},b))})]})},xe=r=>{var re,J,c;const{id:e,unitId:t,subUnitId:n,refStr:o,showEdit:a=!0,onClick:v,showHighlight:S,onClose:g,getSubUnitName:D,prefix:$,autoFocus:W,onMouseEnter:k,onMouseLeave:_,onAddComment:f,onDeleteComment:p,onResolve:M,type:w,style:Z,full:x}=r,L=m.useDependency(V.ThreadCommentModel),[h,C]=d.useState(!1),[I,T]=d.useState(""),b=d.useMemo(()=>L.commentUpdate$.pipe(Q.debounceTime(16)),[L]);m.useObservable(b);const l=e?L.getCommentWithChildren(t,n,e):null,N=m.useDependency(s.ICommandService),z=m.useDependency(s.UserManagerService),O=l==null?void 0:l.root.resolved,j=m.useObservable(z.currentUser$),B=d.useRef(null),Y=[...l?[l.root]:[{id:be,text:{dataStream:`
|
|
4
|
+
\r`},personId:(re=j==null?void 0:j.userID)!=null?re:"",ref:o!=null?o:"",dT:"",unitId:t,subUnitId:n,threadId:""}],...(J=l==null?void 0:l.children)!=null?J:[]],H=d.useRef(null),X=y=>{y.stopPropagation(),O?N.executeCommand(F.id,{unitId:t,subUnitId:n,commentId:e}):N.executeCommand(F.id),N.executeCommand(V.ResolveCommentCommand.id,{unitId:t,subUnitId:n,commentId:e,resolved:!O}),M==null||M(!O)},R=y=>{y.stopPropagation(),N.executeCommand(F.id),!(l!=null&&l.root&&(p==null?void 0:p(l.root))===!1)&&(N.executeCommand(V.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:n,commentId:e}),g==null||g())};d.useEffect(()=>_==null?void 0:_(),[]);const ee=D((c=l==null?void 0:l.root.subUnitId)!=null?c:n),te=a&&!I&&!O,ne=`${o||(l==null?void 0:l.root.ref)||""}${ee?" · ":""}${ee}`;return i.jsxs("div",{id:`${$}-${t}-${n}-${e}`,className:U.clsx("univer-relative univer-box-border univer-rounded-md univer-bg-white univer-p-4 dark:!univer-bg-gray-900 dark:!univer-text-white",U.borderClassName,{"univer-w-[278px]":!x,"univer-w-full":x,"univer-shadow":!O&&(S||h||$==="cell")}),style:Z,onClick:v,onMouseEnter:()=>{k==null||k(),C(!0)},onMouseLeave:()=>{_==null||_(),C(!1)},children:[!O&&S&&i.jsx("div",{className:"univer-absolute univer-left-0 univer-right-0 univer-top-0 univer-h-1.5 univer-rounded-t-md univer-bg-yellow-400"}),i.jsxs("div",{className:"univer-mb-4 univer-flex univer-flex-row univer-items-center univer-justify-between univer-text-sm univer-leading-5",children:[i.jsxs("div",{className:"univer-flex univer-flex-1 univer-flex-row univer-items-center univer-overflow-hidden",children:[i.jsx("div",{className:"univer-mr-2 univer-h-3.5 univer-w-[3px] univer-flex-shrink-0 univer-flex-grow-0 univer-rounded-sm univer-bg-yellow-500"}),i.jsx(U.Tooltip,{showIfEllipsis:!0,title:ne,children:i.jsx("span",{className:"univer-flex-1 univer-truncate",children:ne})})]}),!!l&&i.jsxs("div",{className:"univer-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-row",children:[i.jsx("div",{className:U.clsx("univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800",{"univer-text-green-500":O}),onClick:X,children:O?i.jsx(pe,{}):i.jsx(Ce,{})}),(j==null?void 0:j.userID)===l.root.personId?i.jsx("div",{className:"univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800",onClick:R,children:i.jsx(ve,{})}):null]})]}),i.jsx("div",{ref:H,className:U.clsx("univer-max-h-80 univer-overflow-y-auto univer-overflow-x-hidden",U.scrollbarClassName),children:Y.map(y=>i.jsx(We,{unitId:t,subUnitId:n,item:y,isRoot:y.id===(l==null?void 0:l.root.id),editing:I===y.id,resolved:l==null?void 0:l.root.resolved,type:w,onClose:g,onEditingChange:P=>{T(P?y.id:"")},onReply:P=>{P&&requestAnimationFrame(()=>{var A;(A=B.current)==null||A.reply(Ae([{type:"mention",content:{id:P.userID,label:`@${P.name}`}},{type:"text",content:" "}]))})},onAddComment:f,onDeleteComment:p},y.id))}),te&&i.jsx("div",{children:i.jsx(Ie,{ref:B,type:w,unitId:t,subUnitId:n,onSave:async({text:y,attachments:P})=>{const A={text:y,attachments:P,dT:V.getDT(),id:s.generateRandomId(),ref:o,personId:j==null?void 0:j.userID,parentId:l==null?void 0:l.root.id,unitId:t,subUnitId:n,threadId:l==null?void 0:l.root.threadId};(f==null?void 0:f(A))!==!1&&(await N.executeCommand(V.AddCommentCommand.id,{unitId:t,subUnitId:n,comment:A}),H.current&&(H.current.scrollTop=H.current.scrollHeight))},autoFocus:W||!l,onCancel:()=>{l||g==null||g()}},`${W}`)})]})},Ze=r=>{const{unitId:e,subUnitId$:t,type:n,onAdd:o,getSubUnitName:a,onResolve:v,sortComments:S,onItemLeave:g,onItemEnter:D,disableAdd:$,tempComment:W,onAddComment:k,onDeleteComment:_,showComments:f}=r,[p,M]=d.useState("all"),[w,Z]=d.useState("all"),x=m.useDependency(s.LocaleService),L=m.useDependency(s.UserManagerService),h=m.useDependency(V.ThreadCommentModel),[C,I]=d.useState(()=>h.getUnit(e)),T=m.useDependency(u.ThreadCommentPanelService),b=m.useObservable(T.activeCommentId$),l=m.useObservable(h.commentUpdate$),N=m.useDependency(s.ICommandService),z=m.useObservable(t),O=d.useRef(!0),j="panel",B=m.useObservable(L.currentUser$),Y=d.useMemo(()=>{var A;const c=p==="all"?C:(A=C.filter(E=>E.subUnitId===z))!=null?A:[],y=S!=null?S:(E=>E),P=c.map(E=>{var K;return{...E.root,children:(K=E.children)!=null?K:[],users:E.relativeUsers}});if(f){const E=new Map;return P.forEach(K=>{E.set(K.id,K)}),[...f,""].map(K=>E.get(K)).filter(Boolean)}else return y(P)},[f,p,C,S,z]),H=d.useMemo(()=>[...Y.filter(c=>!c.resolved),...Y.filter(c=>c.resolved)],[Y]),X=d.useMemo(()=>w==="resolved"?H.filter(c=>c.resolved):w==="unsolved"?H.filter(c=>!c.resolved):w==="concern_me"&&B!=null&&B.userID?H.filter(c=>c==null?void 0:c.users.has(B.userID)):H,[H,B==null?void 0:B.userID,w]),R=W?[W,...X]:X,ee=R.filter(c=>!c.resolved),te=R.filter(c=>c.resolved),ne=w!=="all"||p!=="all",re=()=>{Z("all"),M("all")};d.useEffect(()=>{e&&I(h.getUnit(e))},[e,h,l]),d.useEffect(()=>{var E;if(!b)return;if(!O.current){O.current=!0;return}const{unitId:c,subUnitId:y,commentId:P}=b,A=`${j}-${c}-${y}-${P}`;(E=document.getElementById(A))==null||E.scrollIntoView({block:"center"})},[b]);const J=c=>i.jsx(xe,{prefix:j,getSubUnitName:a,id:c.id,unitId:c.unitId,subUnitId:c.subUnitId,refStr:c.ref,type:n,showEdit:(b==null?void 0:b.commentId)===c.id,showHighlight:(b==null?void 0:b.commentId)===c.id,onClick:()=>{O.current=!1,c.resolved?N.executeCommand(F.id):N.executeCommand(F.id,{unitId:c.unitId,subUnitId:c.subUnitId,commentId:c.id,temp:!1})},onMouseEnter:()=>D==null?void 0:D(c),onMouseLeave:()=>g==null?void 0:g(c),onAddComment:k,onDeleteComment:_,onResolve:y=>v==null?void 0:v(c.id,y)},c.id);return i.jsxs("div",{className:"univer-flex univer-min-h-full univer-flex-col univer-pb-3",children:[i.jsxs("div",{className:"univer-mt-3 univer-flex univer-flex-row univer-justify-between",children:[n===s.UniverInstanceType.UNIVER_SHEET?i.jsx(U.Select,{borderless:!0,value:p,options:[{value:"current",label:x.t("threadCommentUI.filter.sheet.current")},{value:"all",label:x.t("threadCommentUI.filter.sheet.all")}],onChange:M}):null,i.jsx(U.Select,{borderless:!0,value:w,options:[{value:"all",label:x.t("threadCommentUI.filter.status.all")},{value:"resolved",label:x.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:x.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:x.t("threadCommentUI.filter.status.concernMe")}],onChange:Z})]}),R.length===0?i.jsxs("div",{className:"univer-flex univer-flex-1 univer-flex-col univer-items-center univer-justify-center univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:[x.t("threadCommentUI.panel.empty"),ne?i.jsx("div",{className:"univer-mt-2 univer-flex univer-flex-row",children:i.jsx(U.Button,{onClick:re,children:x.t("threadCommentUI.panel.reset")})}):$?null:i.jsx("div",{className:"univer-mt-2 univer-flex univer-flex-row",children:i.jsxs(U.Button,{onClick:o,children:[i.jsx(me,{className:"univer-mr-1.5"}),x.t("threadCommentUI.panel.addComment")]})})]}):i.jsxs("div",{className:"univer-mt-3 univer-flex univer-flex-col univer-gap-3",children:[ee.map(J),te.length>0&&i.jsx("div",{className:"univer-text-xs",children:x.t("threadCommentUI.panel.solved")}),te.map(J)]})]})};u.SetActiveCommentOperation=F,u.THREAD_COMMENT_PANEL=ae,u.ThreadCommentPanel=Ze,u.ThreadCommentTree=xe,u.ToggleSheetCommentPanelOperation=le,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +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.UniverThreadCommentUiSkSK=t())})(this,(function(){"use strict";return{threadCommentUI:{panel:{title:"Správa komentárov",empty:"Zatiaľ žiadne komentáre",filterEmpty:"Žiadne zodpovedajúce výsledky",reset:"Obnoviť filter",addComment:"Pridať komentár",solved:"Vyriešené"},editor:{placeholder:"Odpovedzte alebo pridajte ostatných pomocou @",reply:"Komentovať",cancel:"Zrušiť",save:"Uložiť"},item:{edit:"Upraviť",delete:"Odstrániť tento komentár"},filter:{sheet:{all:"Všetky hárky",current:"Aktuálny hárok"},status:{all:"Všetky komentáre",resolved:"Vyriešené",unsolved:"Nevyriešené",concernMe:"Týka sa ma"}}}}}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/thread-comment-ui",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Univer common thread comment UI plugin",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@univerjs/icons": "^1.1.1",
|
|
56
|
-
"@univerjs/core": "0.15.
|
|
57
|
-
"@univerjs/design": "0.15.
|
|
58
|
-
"@univerjs/docs-ui": "0.15.
|
|
59
|
-
"@univerjs/
|
|
60
|
-
"@univerjs/
|
|
56
|
+
"@univerjs/core": "0.15.4",
|
|
57
|
+
"@univerjs/design": "0.15.4",
|
|
58
|
+
"@univerjs/docs-ui": "0.15.4",
|
|
59
|
+
"@univerjs/thread-comment": "0.15.4",
|
|
60
|
+
"@univerjs/ui": "0.15.4"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"postcss": "^8.5.6",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"tailwindcss": "3.4.18",
|
|
67
67
|
"typescript": "^5.9.3",
|
|
68
68
|
"vite": "^7.3.1",
|
|
69
|
-
"vitest": "^4.0.
|
|
70
|
-
"@univerjs-infra/shared": "0.15.
|
|
69
|
+
"vitest": "^4.0.18",
|
|
70
|
+
"@univerjs-infra/shared": "0.15.4"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"test": "vitest run",
|