@univerjs/preset-docs-thread-comment 0.5.0 → 0.5.1-nightly.202412271606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locales/fr-FR.js +1 -0
- package/lib/es/index.js +10 -10
- package/lib/es/locales/fr-FR.js +9 -0
- package/lib/index.css +1 -1
- package/lib/types/index.d.ts +3 -15
- package/lib/types/locales/fr-FR.d.ts +2 -0
- package/lib/types/umd.d.ts +10 -0
- package/lib/umd/index.js +8 -11
- package/lib/umd/locales/fr-FR.js +6 -0
- package/package.json +10 -8
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@univerjs/docs-thread-comment-ui"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@univerjs/docs-thread-comment-ui"),r=require("@univerjs/thread-comment-ui");function n(e={}){return{plugins:[r.UniverThreadCommentUIPlugin,t.UniverDocsThreadCommentUIPlugin]}}exports.UniverDocsThreadCommentPreset=n;Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});Object.keys(r).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@univerjs/core"),r=require("@univerjs/thread-comment-ui/locale/fr-FR"),o=e.Tools.deepMerge({},r);module.exports=o;
|
package/lib/es/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { UniverDocsThreadCommentUIPlugin as
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { UniverDocsThreadCommentUIPlugin as r } from "@univerjs/docs-thread-comment-ui";
|
|
2
|
+
export * from "@univerjs/docs-thread-comment-ui";
|
|
3
|
+
import { UniverThreadCommentUIPlugin as o } from "@univerjs/thread-comment-ui";
|
|
4
|
+
export * from "@univerjs/thread-comment-ui";
|
|
5
|
+
function i(e = {}) {
|
|
6
|
+
return { plugins: [
|
|
7
|
+
o,
|
|
8
|
+
r
|
|
9
|
+
] };
|
|
10
10
|
}
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
i as UniverDocsThreadCommentPreset
|
|
13
13
|
};
|
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-thread-comment-editor-buttons{margin-top:12px;display:flex;flex-direction:row;justify-content:flex-end}.univer-thread-comment-editor-suggestion{display:flex;align-items:center;font-size:13px;color:rgb(var(--color-black))}.univer-thread-comment-editor-suggestionActive{background-color:rgba(var(--grey-50))}.univer-thread-comment-editor-suggestion-icon{width:24px;height:24px;border-radius:12px;margin-right:6px}.univer-thread-comment{padding:16px;background:rgba(var(--color-white));border:1px solid rgba(var(--grey-200));border-radius:8px;box-sizing:border-box;position:relative;width:278px}.univer-thread-comment-active{box-shadow:var(--box-shadow-base)}.univer-thread-comment-content{max-height:300px;overflow-y:auto;overflow-x:hidden;scrollbar-color:rgba(var(--scrollbar-color),.7) transparent;scrollbar-gutter:auto;scrollbar-width:thin}.univer-thread-comment-highlight{background-color:rgb(var(--gold-400));position:absolute;top:0;left:0;right:0;height:6px;border-top-left-radius:6px;border-top-right-radius:6px}.univer-thread-comment-icon-container{display:flex;flex-direction:row;flex-shrink:0;flex-grow:0}.univer-thread-comment-icon{width:24px;height:24px;border-radius:3px;margin-left:4px;display:inline-flex;justify-content:center;align-items:center;cursor:pointer;font-size:16px}.univer-thread-comment-icon:hover{background-color:rgba(var(--grey-50))}.univer-thread-comment-title{display:flex;flex-direction:row;align-items:center;justify-content:space-between;margin-bottom:16px;font-size:14px;line-height:20px}.univer-thread-comment-title-position{display:flex;flex-direction:row;align-items:center;flex:1 1 0;overflow:hidden}.univer-thread-comment-title-highlight{width:3px;height:14px;border-radius:1.5px;background-color:rgba(var(--gold-400));margin-right:8px;flex-shrink:0;flex-grow:0}.univer-thread-comment-title-position-text{flex:1 1 0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.univer-thread-comment-username{font-size:14px;font-weight:500;line-height:20px}.univer-thread-comment-item{margin-bottom:12px;padding-left:30px;position:relative}.univer-thread-comment-item-head{width:24px;height:24px;border-radius:12px;position:absolute;left:0;top:0}.univer-thread-comment-item-title{display:flex;justify-content:space-between;height:24px;align-items:center;margin-bottom:4px}.univer-thread-comment-item-title-position{color:rgba(var(--color-black));font-size:14px;line-height:20px}.univer-thread-comment-item-title-highlight{width:3px;height:14px;border-radius:2px;margin-right:8px;margin-top:3px;background-color:rgba(var(--gold-400))}.univer-thread-comment-item-time{font-size:12px;line-height:1.5;margin-bottom:4px;color:rgba(var(--grey-600))}.univer-thread-comment-item-content{font-size:13px;line-height:20px;color:rgba(var(--color-black))}.univer-thread-comment-item-at{color:rgba(var(--blue-400))}.univer-thread-comment-panel{min-height:100%;display:flex;flex-direction:column;padding-bottom:12px}.univer-thread-comment-panel .univer-thread-comment{margin-top:12px}.univer-thread-comment-panel-forms{display:flex;flex-direction:row;justify-content:space-between;margin-top:12px}.univer-thread-comment-panel-forms .univer-select{width:120px}.univer-thread-comment-panel-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;color:rgb(var(--grey-600));font-size:13px;flex:1}.univer-thread-comment-panel-add{margin-top:8px;display:flex;flex-direction:row}.univer-thread-comment-panel-add svg{margin-right:6px}.univer-thread-comment-panel-solved{margin-top:12px;font-size:var(--font-size-xs)}
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(63 131 248 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(63 131 248 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*{scrollbar-color:initial;scrollbar-width:initial}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.univer-thread-comment-editor-buttons{margin-top:12px;display:flex;flex-direction:row;justify-content:flex-end}.univer-thread-comment-editor-suggestion{display:flex;align-items:center;font-size:13px;color:rgb(var(--color-black))}.univer-thread-comment-editor-suggestionActive{background-color:rgba(var(--grey-50))}.univer-thread-comment-editor-suggestion-icon{width:24px;height:24px;border-radius:12px;margin-right:6px}.univer-thread-comment{padding:16px;background:rgba(var(--color-white));border:1px solid rgba(var(--grey-200));border-radius:8px;box-sizing:border-box;position:relative;width:278px}.univer-thread-comment-active{box-shadow:var(--box-shadow-base)}.univer-thread-comment-content{max-height:300px;overflow-y:auto;overflow-x:hidden;scrollbar-color:rgba(var(--scrollbar-color),.7) transparent;scrollbar-gutter:auto;scrollbar-width:thin}.univer-thread-comment-highlight{background-color:rgb(var(--gold-400));position:absolute;top:0;left:0;right:0;height:6px;border-top-left-radius:6px;border-top-right-radius:6px}.univer-thread-comment-icon-container{display:flex;flex-direction:row;flex-shrink:0;flex-grow:0}.univer-thread-comment-icon{width:24px;height:24px;border-radius:3px;margin-left:4px;display:inline-flex;justify-content:center;align-items:center;cursor:pointer;font-size:16px}.univer-thread-comment-icon:hover{background-color:rgba(var(--grey-50))}.univer-thread-comment-title{display:flex;flex-direction:row;align-items:center;justify-content:space-between;margin-bottom:16px;font-size:14px;line-height:20px}.univer-thread-comment-title-position{display:flex;flex-direction:row;align-items:center;flex:1 1 0;overflow:hidden}.univer-thread-comment-title-highlight{width:3px;height:14px;border-radius:1.5px;background-color:rgba(var(--gold-400));margin-right:8px;flex-shrink:0;flex-grow:0}.univer-thread-comment-title-position-text{flex:1 1 0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.univer-thread-comment-username{font-size:14px;font-weight:500;line-height:20px}.univer-thread-comment-item{margin-bottom:12px;padding-left:30px;position:relative}.univer-thread-comment-item-head{width:24px;height:24px;border-radius:12px;position:absolute;left:0;top:0}.univer-thread-comment-item-title{display:flex;justify-content:space-between;height:24px;align-items:center;margin-bottom:4px}.univer-thread-comment-item-title-position{color:rgba(var(--color-black));font-size:14px;line-height:20px}.univer-thread-comment-item-title-highlight{width:3px;height:14px;border-radius:2px;margin-right:8px;margin-top:3px;background-color:rgba(var(--gold-400))}.univer-thread-comment-item-time{font-size:12px;line-height:1.5;margin-bottom:4px;color:rgba(var(--grey-600))}.univer-thread-comment-item-content{font-size:13px;line-height:20px;color:rgba(var(--color-black))}.univer-thread-comment-item-at{color:rgba(var(--blue-400))}.univer-thread-comment-panel{min-height:100%;display:flex;flex-direction:column;padding-bottom:12px}.univer-thread-comment-panel .univer-thread-comment{margin-top:12px}.univer-thread-comment-panel-forms{display:flex;flex-direction:row;justify-content:space-between;margin-top:12px}.univer-thread-comment-panel-forms .univer-select{width:120px}.univer-thread-comment-panel-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;color:rgb(var(--grey-600));font-size:13px;flex:1}.univer-thread-comment-panel-add{margin-top:8px;display:flex;flex-direction:row}.univer-thread-comment-panel-add svg{margin-right:6px}.univer-thread-comment-panel-solved{margin-top:12px;font-size:var(--font-size-xs)}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
/**
|
|
5
|
-
* If you would like to use comment with Univer's first-party collaboration features,
|
|
6
|
-
* please set this option to `true`.
|
|
7
|
-
*/
|
|
8
|
-
collaboration?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* This preset add thread comment features into your application.
|
|
12
|
-
*
|
|
13
|
-
* @param {Partial<IUniverDocsThreadCommentPresetConfig>} config - The configuration object.
|
|
14
|
-
*/
|
|
15
|
-
export declare function UniverDocsThreadCommentPreset(config?: Partial<IUniverDocsThreadCommentPresetConfig>): IPreset;
|
|
1
|
+
export * from './umd';
|
|
2
|
+
export * from '@univerjs/docs-thread-comment-ui';
|
|
3
|
+
export * from '@univerjs/thread-comment-ui';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IPreset } from './types';
|
|
2
|
+
import '@univerjs/thread-comment-ui/lib/index.css';
|
|
3
|
+
export interface IUniverDocsThreadCommentPresetConfig {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* This preset add thread comment features into your application.
|
|
7
|
+
*
|
|
8
|
+
* @param {Partial<IUniverDocsThreadCommentPresetConfig>} config - The configuration object.
|
|
9
|
+
*/
|
|
10
|
+
export declare function UniverDocsThreadCommentPreset(_config?: Partial<IUniverDocsThreadCommentPresetConfig>): IPreset;
|
package/lib/umd/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @univerjs/thread-comment-ui/index
|
|
2
|
-
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverThreadCommentUi={},c.UniverCore,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React,c.UniverDesign,c.UniverDocs,c.UniverDocsUi,c.UniverEngineRender))})(this,function(c,o,
|
|
2
|
+
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverThreadCommentUi={},c.UniverCore,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React,c.UniverDesign,c.UniverDocs,c.UniverDocsUi,c.UniverEngineRender))})(this,function(c,o,_,k,re,h,E,Oe,Me,we){"use strict";var st=Object.defineProperty;var dt=(c,o,_)=>o in c?st(c,o,{enumerable:!0,configurable:!0,writable:!0,value:_}):c[o]=_;var G=(c,o,_)=>dt(c,typeof o!="symbol"?o+"":o,_);var De=Object.defineProperty,He=Object.getOwnPropertyDescriptor,Ae=(n,e,t,r)=>{for(var i=r>1?void 0:r?He(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&De(e,t,i),i},ce=(n,e)=>(t,r)=>e(t,r,n);c.ThreadCommentPanelService=class extends o.Disposable{constructor(t,r){super();G(this,"_panelVisible",!1);G(this,"_panelVisible$",new re.BehaviorSubject(!1));G(this,"_activeCommentId");G(this,"_activeCommentId$",new re.BehaviorSubject(void 0));G(this,"panelVisible$",this._panelVisible$.asObservable());G(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$(o.UniverInstanceType.UNIVER_SHEET).pipe(re.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)}},c.ThreadCommentPanelService=Ae([ce(0,o.Inject(k.ISidebarService)),ce(1,o.IUniverInstanceService)],c.ThreadCommentPanelService);const he="thread-comment-panel",Le="UNIVER_THREAD_COMMENT_UI_PLUGIN",ue={id:"thread-comment-ui.operation.toggle-panel",type:o.CommandType.OPERATION,handler(n){const e=n.get(k.ISidebarService),t=n.get(c.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:he},width:330}),t.setPanelVisible(!0)),!0}},W={id:"thread-comment-ui.operation.set-active-comment",type:o.CommandType.OPERATION,handler(n,e){return n.get(c.ThreadCommentPanelService).setActiveComment(e),!0}},ke="thread-comment-ui.config",ve={};var Ce=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,Be=(n,e,t)=>e in n?Ce(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Fe=(n,e,t,r)=>{for(var i=r>1?void 0:r?Ve(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&Ce(e,t,i),i},le=(n,e)=>(t,r)=>e(t,r,n),fe=(n,e,t)=>Be(n,typeof e!="symbol"?e+"":e,t);c.UniverThreadCommentUIPlugin=class extends o.Plugin{constructor(e=ve,t,r,i){super(),this._config=e,this._injector=t,this._commandService=r,this._configService=i;const{menu:s,...l}=o.merge({},ve,this._config);s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(ke,l)}onStarting(){var e;o.mergeOverrideWithDependencies([[c.ThreadCommentPanelService]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[ue,W].forEach(t=>{this._commandService.registerCommand(t)})}},fe(c.UniverThreadCommentUIPlugin,"pluginName",Le),fe(c.UniverThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_UNKNOWN),c.UniverThreadCommentUIPlugin=Fe([o.DependentOn(_.UniverThreadCommentPlugin),le(1,o.Inject(o.Injector)),le(2,o.ICommandService),le(3,o.IConfigService)],c.UniverThreadCommentUIPlugin);var me={exports:{}},Y={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|
|
5
5
|
*
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var
|
|
11
|
-
\r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},
|
|
12
|
-
\r`},personId:(ae=
|
|
10
|
+
*/var pe;function We(){if(pe)return Y;pe=1;var n=h,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(C,u,U){var f,p={},I=null,T=null;U!==void 0&&(I=""+U),u.key!==void 0&&(I=""+u.key),u.ref!==void 0&&(T=u.ref);for(f in u)r.call(u,f)&&!s.hasOwnProperty(f)&&(p[f]=u[f]);if(C&&C.defaultProps)for(f in u=C.defaultProps,u)p[f]===void 0&&(p[f]=u[f]);return{$$typeof:e,type:C,key:I,ref:T,props:p,_owner:i.current}}return Y.Fragment=t,Y.jsx=l,Y.jsxs=l,Y}var ge;function ze(){return ge||(ge=1,me.exports=We()),me.exports}var a=ze(),M=function(){return M=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},M.apply(this,arguments)},Ze=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},z=h.forwardRef(function(n,e){var t=n.icon,r=n.id,i=n.className,s=n.extend,l=Ze(n,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(r," ").concat(i||"").trim(),u=h.useRef("_".concat(Ke()));return Ie(t,"".concat(r),{defIds:t.defIds,idSuffix:u.current},M({ref:e,className:C},l),s)});function Ie(n,e,t,r,i){return h.createElement(n.tag,M(M({key:e},Je(n,t,i)),r),(Ge(n,t).children||[]).map(function(s,l){return Ie(s,"".concat(e,"-").concat(n.tag,"-").concat(l),t,void 0,i)}))}function Je(n,e,t){var r=M({},n.attrs);t!=null&&t.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=t.colorChannel1);var i=e.defIds;return!i||i.length===0||(n.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(s){var l=s[0],C=s[1];typeof C=="string"&&(r[l]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function Ge(n,e){var t,r=e.defIds;return!r||r.length===0?n:n.tag==="defs"&&(!((t=n.children)===null||t===void 0)&&t.length)?M(M({},n),{children:n.children.map(function(i){return typeof i.attrs.id=="string"&&r&&r.indexOf(i.attrs.id)>-1?M(M({},i),{attrs:M(M({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):n}function Ke(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";var Ye={tag:"svg",attrs:{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.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.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.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.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"}}]},xe=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"delete-single",ref:e,icon:Ye}))});xe.displayName="DeleteSingle";var Qe={tag:"svg",attrs:{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"}}]},Se=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"increase-single",ref:e,icon:Qe}))});Se.displayName="IncreaseSingle";var Xe={tag:"svg",attrs:{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 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z"}}]},ye=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"more-horizontal-single",ref:e,icon:Xe}))});ye.displayName="MoreHorizontalSingle";var qe={tag:"svg",attrs:{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.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},be=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"reply-to-comment-single",ref:e,icon:qe}))});be.displayName="ReplyToCommentSingle";var $e={tag:"svg",attrs:{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"}}]},Te=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"resolved-single",ref:e,icon:$e}))});Te.displayName="ResolvedSingle";var et={tag:"svg",attrs:{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}}]},_e=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"solve-single",ref:e,icon:et}))});_e.displayName="SolveSingle";function je(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=je(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function tt(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=je(n))&&(r&&(r+=" "),r+=e);return r}const ie={threadCommentEditorButtons:"univer-thread-comment-editor-buttons",threadCommentEditorSuggestion:"univer-thread-comment-editor-suggestion",threadCommentEditorSuggestionActive:"univer-thread-comment-editor-suggestionActive",threadCommentEditorSuggestionIcon:"univer-thread-comment-editor-suggestion-icon"},nt=n=>{const e=/@\[(.*?)\]\((.*?)\)|(\w+)/g;let t,r=0;const i=[];for(;(t=e.exec(n))!==null;)t.index>r&&i.push({type:"text",content:n.substring(r,t.index)}),t[1]&&t[2]?i.push({type:"mention",content:{label:t[1],id:t[2]}}):t[3]&&i.push({type:"text",content:t[3]}),r=e.lastIndex;return r<n.length&&i.push({type:"text",content:n.substring(r)}),i},rt=n=>n.map(e=>{switch(e.type){case"mention":return`@[${e.content.label}](${e.content.id})`;default:return e.content}}).join(""),Ue=n=>{const{dataStream:e,customRanges:t}=n,r=e.length-2,i=[];let s=0;return t==null||t.forEach(l=>{s<l.startIndex&&i.push({type:"text",content:e.slice(s,l.startIndex)}),i.push({type:"mention",content:{label:e.slice(l.startIndex,l.endIndex).slice(1,-1),id:l.rangeId}}),s=l.endIndex}),i.push({type:"text",content:e.slice(s,r)}),i},Pe=n=>{let e="";const t=[];return n.forEach(r=>{switch(r.type){case"text":e+=r.content;break;case"mention":{const i=e.length;e+=`${r.content.label}`;const s=e.length;t.push({rangeId:r.content.id,rangeType:o.CustomRangeType.MENTION,startIndex:i,endIndex:s,properties:{}});break}}}),e+=`
|
|
11
|
+
\r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},it=(n,e,t,r,i)=>{var l,C;const s=(l=n.raw)==null?void 0:l.icon;return a.jsxs("div",{className:ie.threadCommentEditorSuggestion,children:[s?a.jsx("img",{className:ie.threadCommentEditorSuggestionIcon,src:s}):null,a.jsx("div",{children:(C=n.display)!=null?C:n.id})]})},Ee=h.forwardRef((n,e)=>{var V;const{comment:t,onSave:r,id:i,onCancel:s,autoFocus:l,unitId:C}=n,u=o.useDependency(o.IMentionIOService),U=o.useDependency(o.ICommandService),f=o.useDependency(o.LocaleService),[p,I]=h.useState({...t}),[T,x]=h.useState(!1),y=h.useRef(null),D=o.useDependency(Oe.DocSelectionManagerService),N=(V=o.useDependency(we.IRenderManagerService).getCurrentTypeOfRenderer(o.UniverInstanceType.UNIVER_DOC))==null?void 0:V.with(Me.DocSelectionRenderService);h.useImperativeHandle(e,()=>({reply(v){var b;I({...t,text:v,attachments:[]}),(b=y.current)==null||b.inputElement.focus()}}));const S=()=>{var v;p.text&&(r==null||r({...p,text:p.text}),x(!1),I({text:void 0}),(v=y.current)==null||v.inputElement.blur())};return a.jsxs("div",{className:ie.threadCommentEditor,onClick:v=>v.preventDefault(),children:[a.jsx(E.Mentions,{ref:y,autoFocus:l,style:{width:"100%"},placeholder:f.t("threadCommentUI.editor.placeholder"),value:p!=null&&p.text?rt(Ue(p.text)):"",onChange:v=>{v.target.value||I({...t,text:void 0}),I==null||I({...t,text:Pe(nt(v.target.value))})},onFocus:()=>{const v=D.getActiveTextRange();v&&v.collapsed&&(N==null||N.removeAllRanges()),N==null||N.blur(),x(!0)},children:a.jsx(E.Mention,{trigger:"@",data:(v,b)=>u.list({search:v,unitId:C}).then(m=>m.list.map(H=>H.mentions.map(j=>({id:j.objectId,display:j.label,raw:j}))).flat()).then(b),displayTransform:(v,b)=>`@${b} `,renderSuggestion:it},"@")}),T?a.jsxs("div",{className:ie.threadCommentEditorButtons,children:[a.jsx(E.Button,{style:{marginRight:12},onClick:()=>{s==null||s(),x(!1),I({text:void 0}),U.executeCommand(W.id)},children:f.t("threadCommentUI.editor.cancel")}),a.jsx(E.Button,{type:"primary",disabled:!p.text,onClick:S,children:f.t(i?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),g={threadComment:"univer-thread-comment",threadCommentActive:"univer-thread-comment-active",threadCommentContent:"univer-thread-comment-content",threadCommentHighlight:"univer-thread-comment-highlight",threadCommentIconContainer:"univer-thread-comment-icon-container",threadCommentIcon:"univer-thread-comment-icon",threadCommentTitle:"univer-thread-comment-title",threadCommentTitlePosition:"univer-thread-comment-title-position",threadCommentTitleHighlight:"univer-thread-comment-title-highlight",threadCommentTitlePositionText:"univer-thread-comment-title-position-text",threadCommentUsername:"univer-thread-comment-username",threadCommentItem:"univer-thread-comment-item",threadCommentItemHead:"univer-thread-comment-item-head",threadCommentItemTitle:"univer-thread-comment-item-title",threadCommentItemTitlePosition:"univer-thread-comment-item-title-position",threadCommentItemTitleHighlight:"univer-thread-comment-item-title-highlight",threadCommentItemTime:"univer-thread-comment-item-time",threadCommentItemContent:"univer-thread-comment-item-content",threadCommentItemAt:"univer-thread-comment-item-at"},Ne="__mock__",ot=n=>{const{item:e,unitId:t,subUnitId:r,editing:i,onEditingChange:s,onReply:l,resolved:C,isRoot:u,onClose:U,onDeleteComment:f}=n,p=o.useDependency(o.ICommandService),I=o.useDependency(o.LocaleService),T=o.useDependency(o.UserManagerService),x=T.getUser(e.personId),y=k.useObservable(T.currentUser$),D=(y==null?void 0:y.userID)===e.personId,P=e.id===Ne,[N,S]=h.useState(!1),V=()=>{(f==null?void 0:f(e))!==!1&&(p.executeCommand(u?_.DeleteCommentTreeCommand.id:_.DeleteCommentCommand.id,{unitId:t,subUnitId:r,commentId:e.id}),u&&(U==null||U()))};return a.jsxs("div",{className:g.threadCommentItem,onMouseLeave:()=>S(!1),onMouseEnter:()=>S(!0),children:[a.jsx("img",{className:g.threadCommentItemHead,src:x==null?void 0:x.avatar}),a.jsxs("div",{className:g.threadCommentItemTitle,children:[a.jsx("div",{className:g.threadCommentUsername,children:(x==null?void 0:x.name)||" "}),a.jsxs("div",{children:[P||C?null:N?a.jsx("div",{className:g.threadCommentIcon,onClick:()=>l(x),children:a.jsx(be,{})}):null,D&&!P&&!C?a.jsx(E.DropdownLegacy,{overlay:a.jsxs(E.Menu,{children:[a.jsx(E.MenuItem,{onClick:()=>s==null?void 0:s(!0),children:I.t("threadCommentUI.item.edit")},"edit"),a.jsx(E.MenuItem,{onClick:V,children:I.t("threadCommentUI.item.delete")},"delete")]}),children:a.jsx("div",{className:g.threadCommentIcon,children:a.jsx(ye,{})})}):null]})]}),a.jsx("div",{className:g.threadCommentItemTime,children:e.dT}),i?a.jsx(Ee,{id:e.id,comment:e,onCancel:()=>s==null?void 0:s(!1),autoFocus:!0,unitId:t,subUnitId:r,onSave:({text:v,attachments:b})=>{s==null||s(!1),p.executeCommand(_.UpdateCommentCommand.id,{unitId:t,subUnitId:r,payload:{commentId:e.id,text:v,attachments:b}})}}):a.jsx("div",{className:g.threadCommentItemContent,children:Ue(e.text).map((v,b)=>{switch(v.type){case"mention":return a.jsxs("a",{className:g.threadCommentItemAt,children:["@",v.content.label," "]},b);default:return v.content}})})]})},Re=n=>{var ae,ee,te;const{id:e,unitId:t,subUnitId:r,refStr:i,showEdit:s=!0,onClick:l,showHighlight:C,onClose:u,getSubUnitName:U,prefix:f,autoFocus:p,onMouseEnter:I,onMouseLeave:T,onAddComment:x,onDeleteComment:y,onResolve:D}=n,P=o.useDependency(_.ThreadCommentModel),[N,S]=h.useState(!1),[V,v]=h.useState(""),b=h.useMemo(()=>P.commentUpdate$.pipe(re.debounceTime(16)),[P]);k.useObservable(b);const m=e?P.getCommentWithChildren(t,r,e):null,H=o.useDependency(o.ICommandService),j=o.useDependency(o.UserManagerService),A=m==null?void 0:m.root.resolved,w=k.useObservable(j.currentUser$),X=h.useRef(null),q=[...m?[m.root]:[{id:Ne,text:{dataStream:`
|
|
12
|
+
\r`},personId:(ae=w==null?void 0:w.userID)!=null?ae:"",ref:i!=null?i:"",dT:"",unitId:t,subUnitId:r,threadId:""}],...(ee=m==null?void 0:m.children)!=null?ee:[]],Z=h.useRef(null),B=R=>{R.stopPropagation(),A?H.executeCommand(W.id,{unitId:t,subUnitId:r,commentId:e}):H.executeCommand(W.id),H.executeCommand(_.ResolveCommentCommand.id,{unitId:t,subUnitId:r,commentId:e,resolved:!A}),D==null||D(!A)},$=R=>{R.stopPropagation(),H.executeCommand(W.id),!(m!=null&&m.root&&(y==null?void 0:y(m.root))===!1)&&(H.executeCommand(_.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:r,commentId:e}),u==null||u())};h.useEffect(()=>T==null?void 0:T(),[]);const F=U((te=m==null?void 0:m.root.subUnitId)!=null?te:r),oe=s&&!V&&!A,K=`${i||(m==null?void 0:m.root.ref)||""}${F?" · ":""}${F}`;return a.jsxs("div",{className:tt(g.threadComment,{[g.threadCommentActive]:!A&&(C||N||f==="cell")}),onClick:l,id:`${f}-${t}-${r}-${e}`,onMouseEnter:()=>{I==null||I(),S(!0)},onMouseLeave:()=>{T==null||T(),S(!1)},children:[!A&&C?a.jsx("div",{className:g.threadCommentHighlight}):null,a.jsxs("div",{className:g.threadCommentTitle,children:[a.jsxs("div",{className:g.threadCommentTitlePosition,children:[a.jsx("div",{className:g.threadCommentTitleHighlight}),a.jsx(E.Tooltip,{showIfEllipsis:!0,title:K,children:a.jsx("div",{className:g.threadCommentTitlePositionText,children:K})})]}),m?a.jsxs("div",{className:g.threadCommentIconContainer,children:[a.jsx("div",{onClick:B,className:g.threadCommentIcon,style:{color:A?"rgb(var(--green-500))":""},children:A?a.jsx(Te,{}):a.jsx(_e,{})}),(w==null?void 0:w.userID)===m.root.personId?a.jsx("div",{className:g.threadCommentIcon,onClick:$,children:a.jsx(xe,{})}):null]}):null]}),a.jsx("div",{className:g.threadCommentContent,ref:Z,children:q.map(R=>a.jsx(ot,{onClose:u,unitId:t,subUnitId:r,item:R,isRoot:R.id===(m==null?void 0:m.root.id),editing:V===R.id,resolved:m==null?void 0:m.root.resolved,onEditingChange:L=>{v(L?R.id:"")},onReply:L=>{L&&requestAnimationFrame(()=>{var d;(d=X.current)==null||d.reply(Pe([{type:"mention",content:{id:L.userID,label:L.name}}]))})},onAddComment:x,onDeleteComment:y},R.id))}),oe?a.jsx("div",{children:a.jsx(Ee,{ref:X,unitId:t,subUnitId:r,onSave:async({text:R,attachments:L})=>{const d={text:R,attachments:L,dT:_.getDT(),id:o.generateRandomId(),ref:i,personId:w==null?void 0:w.userID,parentId:m==null?void 0:m.root.id,unitId:t,subUnitId:r,threadId:m==null?void 0:m.root.threadId};(x==null?void 0:x(d))!==!1&&(await H.executeCommand(_.AddCommentCommand.id,{unitId:t,subUnitId:r,comment:d}),Z.current&&(Z.current.scrollTop=Z.current.scrollHeight))},autoFocus:p||!m,onCancel:()=>{m||u==null||u()}},`${p}`)}):null]})},Q={threadCommentPanel:"univer-thread-comment-panel",threadComment:"univer-thread-comment",threadCommentPanelForms:"univer-thread-comment-panel-forms",select:"univer-select",threadCommentPanelEmpty:"univer-thread-comment-panel-empty",threadCommentPanelAdd:"univer-thread-comment-panel-add",threadCommentPanelSolved:"univer-thread-comment-panel-solved"},at=n=>{const{unitId:e,subUnitId$:t,type:r,onAdd:i,getSubUnitName:s,onResolve:l,sortComments:C,onItemLeave:u,onItemEnter:U,disableAdd:f,tempComment:p,onAddComment:I,onDeleteComment:T,showComments:x}=n,[y,D]=h.useState("all"),[P,N]=h.useState("all"),S=o.useDependency(o.LocaleService),V=o.useDependency(o.UserManagerService),v=o.useDependency(_.ThreadCommentModel),[b,m]=h.useState(()=>v.getUnit(e)),H=o.useDependency(c.ThreadCommentPanelService),j=k.useObservable(H.activeCommentId$),A=k.useObservable(v.commentUpdate$),w=o.useDependency(o.ICommandService),X=k.useObservable(t),q=h.useRef(!0),Z="panel",B=k.useObservable(V.currentUser$),$=h.useMemo(()=>{var de;const d=y==="all"?b:(de=b.filter(O=>O.subUnitId===X))!=null?de:[],ne=C!=null?C:O=>O,se=d.map(O=>{var J;return{...O.root,children:(J=O.children)!=null?J:[],users:O.relativeUsers}});if(x){const O=new Map;return se.forEach(J=>{O.set(J.id,J)}),[...x,""].map(J=>O.get(J)).filter(Boolean)}else return ne(se)},[x,y,b,C,X]),F=h.useMemo(()=>[...$.filter(d=>!d.resolved),...$.filter(d=>d.resolved)],[$]),oe=h.useMemo(()=>P==="resolved"?F.filter(d=>d.resolved):P==="unsolved"?F.filter(d=>!d.resolved):P==="concern_me"&&B!=null&&B.userID?F.filter(d=>d==null?void 0:d.users.has(B.userID)):F,[F,B==null?void 0:B.userID,P]),K=p?[p,...oe]:oe,ae=K.filter(d=>!d.resolved),ee=K.filter(d=>d.resolved),te=P!=="all"||y!=="all",R=()=>{N("all"),D("all")};h.useEffect(()=>{e&&m(v.getUnit(e))},[e,v,A]),h.useEffect(()=>{var O;if(!j)return;if(!q.current){q.current=!0;return}const{unitId:d,subUnitId:ne,commentId:se}=j,de=`${Z}-${d}-${ne}-${se}`;(O=document.getElementById(de))==null||O.scrollIntoView({block:"center"})},[j]);const L=d=>a.jsx(Re,{prefix:Z,getSubUnitName:s,id:d.id,unitId:d.unitId,subUnitId:d.subUnitId,refStr:d.ref,type:r,showEdit:(j==null?void 0:j.commentId)===d.id,showHighlight:(j==null?void 0:j.commentId)===d.id,onClick:()=>{q.current=!1,d.resolved?w.executeCommand(W.id):w.executeCommand(W.id,{unitId:d.unitId,subUnitId:d.subUnitId,commentId:d.id,temp:!1})},onMouseEnter:()=>U==null?void 0:U(d),onMouseLeave:()=>u==null?void 0:u(d),onAddComment:I,onDeleteComment:T,onResolve:ne=>l==null?void 0:l(d.id,ne)},d.id);return a.jsxs("div",{className:Q.threadCommentPanel,children:[a.jsxs("div",{className:Q.threadCommentPanelForms,children:[r===o.UniverInstanceType.UNIVER_SHEET?a.jsx(E.Select,{borderless:!0,value:y,onChange:d=>D(d),options:[{value:"current",label:S.t("threadCommentUI.filter.sheet.current")},{value:"all",label:S.t("threadCommentUI.filter.sheet.all")}]}):null,a.jsx(E.Select,{borderless:!0,value:P,onChange:d=>N(d),options:[{value:"all",label:S.t("threadCommentUI.filter.status.all")},{value:"resolved",label:S.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:S.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:S.t("threadCommentUI.filter.status.concernMe")}]})]}),ae.map(L),ee.length?a.jsx("div",{className:Q.threadCommentPanelSolved,children:"已解决"}):null,ee.map(L),K.length?null:a.jsxs("div",{className:Q.threadCommentPanelEmpty,children:[te?S.t("threadCommentUI.panel.filterEmpty"):S.t("threadCommentUI.panel.empty"),te?a.jsx(E.Button,{onClick:R,type:"link",children:S.t("threadCommentUI.panel.reset")}):a.jsxs(E.Button,{id:"thread-comment-add",className:Q.threadCommentPanelAdd,type:"primary",onClick:i,disabled:f,children:[a.jsx(Se,{}),S.t("threadCommentUI.panel.addComment")]})]})]})};c.SetActiveCommentOperation=W,c.THREAD_COMMENT_PANEL=he,c.ThreadCommentPanel=at,c.ThreadCommentTree=Re,c.ToggleSheetCommentPanelOperation=ue,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
// @univerjs/docs-thread-comment-ui/index
|
|
16
|
-
(function(
|
|
16
|
+
(function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/thread-comment-ui"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/thread-comment-ui","@univerjs/docs","@univerjs/docs-ui","@univerjs/thread-comment","@univerjs/ui","rxjs","react"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l.UniverDocsThreadCommentUi={},l.UniverCore,l.UniverEngineRender,l.UniverThreadCommentUi,l.UniverDocs,l.UniverDocsUi,l.UniverThreadComment,l.UniverUi,l.rxjs,l.React))})(this,function(l,o,g,T,M,j,w,I,A,O){"use strict";var Ve=Object.defineProperty;var $e=(l,o,g)=>o in l?Ve(l,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):l[o]=g;var Q=(l,o,g)=>$e(l,typeof o!="symbol"?o+"":o,g);const ae="DOC_THREAD_COMMENT_UI_PLUGIN",D="default_doc",ce="docs-thread-comment-ui.config",X={};var me=Object.defineProperty,le=Object.getOwnPropertyDescriptor,ue=(e,t,r,n)=>{for(var i=n>1?void 0:n?le(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&me(t,r,i),i},k=(e,t)=>(r,n)=>t(r,n,e);let U=class extends o.Disposable{constructor(t,r){super();Q(this,"_addingComment$",new A.BehaviorSubject(void 0));Q(this,"addingComment$",this._addingComment$.asObservable());this._sidebarService=t,this._threadCommentPanelService=r,this.disposeWithMe(()=>{this._addingComment$.complete()})}get addingComment(){return this._addingComment$.getValue()}startAdd(t){this._addingComment$.next(t)}endAdd(){this._addingComment$.next(void 0)}};U=ue([k(0,I.ISidebarService),k(1,o.Inject(T.ThreadCommentPanelService))],U);var W={exports:{}},N={};/**
|
|
17
17
|
* @license React
|
|
18
18
|
* react-jsx-runtime.production.min.js
|
|
19
19
|
*
|
|
@@ -21,12 +21,9 @@
|
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the MIT license found in the
|
|
23
23
|
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/var
|
|
25
|
-
`},startOffset:m.startOffset,endOffset:m.endOffset,collapsed:!0,threadId:D};return _==null||_.blurEditor(),a.startAdd(E),t.setActiveComment({unitId:S,subUnitId:u,commentId:D}),!0}};var ge=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Te=(e,t,r,n)=>{for(var i=n>1?void 0:n?Oe(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ge(t,r,i),i},x=(e,t)=>(r,n)=>t(r,n,e);let F=class extends o.Disposable{constructor(e,t,r,n,i,s){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=r,this._docThreadCommentService=n,this._renderManagerService=i,this._threadCommentModel=s,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var r,n,i,s;if(t.id===M.SetTextSelectionsOperation.id){const d=t.params,{unitId:a,ranges:v}=d,h=this._univerInstanceService.getUnit(a,o.UniverInstanceType.UNIVER_DOC),m=v[0];if((e==null?void 0:e.startOffset)===(m==null?void 0:m.startOffset)&&(e==null?void 0:e.endOffset)===(m==null?void 0:m.endOffset))return;if(e=m,m&&h){const{startOffset:_,endOffset:S,collapsed:p}=m;let l;if(p?l=(n=(r=h.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(u=>u.startIndex<=_&&u.endIndex>=S-1):l=(s=(i=h.getBody())==null?void 0:i.customDecorations)==null?void 0:s.find(u=>u.startIndex<=_&&u.endIndex>=S-1),l){const u=this._threadCommentModel.getComment(a,y,l.id);u&&!u.resolved&&this._commandService.executeCommand(N.id,{activeComment:{unitId:a,subUnitId:y,commentId:l.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;this._commandService.executeCommand(T.SetActiveCommentOperation.id)}}))}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t,r,n,i;if(e){const s=this._univerInstanceService.getUnit(e.unitId);if(s){const d=(t=this._renderManagerService.getRenderById(e.unitId))==null?void 0:t.with(j.DocBackScrollRenderController),a=(n=(r=s.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(v=>v.id===e.commentId);a&&d&&d.scrollToRange({startOffset:a.startIndex,endOffset:a.endIndex,collapsed:!1})}}(!e||e.commentId!==((i=this._docThreadCommentService.addingComment)==null?void 0:i.id))&&this._docThreadCommentService.endAdd()}))}};F=Te([x(0,o.Inject(T.ThreadCommentPanelService)),x(1,o.IUniverInstanceService),x(2,o.ICommandService),x(3,o.Inject(U)),x(4,g.IRenderManagerService),x(5,o.Inject(w.ThreadCommentModel))],F);var I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},I.apply(this,arguments)},Me=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},te=O.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,s=e.extend,d=Me(e,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),v=O.useRef("_".concat(be()));return ne(r,"".concat(n),{defIds:r.defIds,idSuffix:v.current},I({ref:t,className:a},d),s)});function ne(e,t,r,n,i){return O.createElement(e.tag,I(I({key:t},ye(e,r,i)),n),(De(e,r).children||[]).map(function(s,d){return ne(s,"".concat(t,"-").concat(e.tag,"-").concat(d),r,void 0,i)}))}function ye(e,t,r){var n=I({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(s){var d=s[0],a=s[1];typeof a=="string"&&(n[d]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function De(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?I(I({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?I(I({},i),{attrs:I(I({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function be(){return Math.random().toString(36).substring(2,8)}te.displayName="UniverIcon";var Ue={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},re=O.forwardRef(function(e,t){return O.createElement(te,Object.assign({},e,{id:"comment-single",ref:t,icon:Ue}))});re.displayName="CommentSingle";const Pe={[C.RibbonStartGroup.OTHERS]:{[G.id]:{order:1,menuItemFactory:Se}},[C.ContextMenuPosition.MAIN_AREA]:{[C.ContextMenuGroup.DATA]:{[V.id]:{order:1,menuItemFactory:_e}}}};var xe=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,Ee=(e,t,r,n)=>{for(var i=n>1?void 0:n?Re(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&xe(t,r,i),i},Z=(e,t)=>(r,n)=>t(r,n,e);let L=class extends o.Disposable{constructor(e,t,r){super(),this._commandService=e,this._menuManagerService=t,this._componentManager=r,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[W,K,N,V,G].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(Pe)}_initComponents(){[P].forEach(e=>{this.disposeWithMe(this._componentManager.register(e.componentKey,e))}),this.disposeWithMe(this._componentManager.register("CommentSingle",re))}};L=Ee([Z(0,o.ICommandService),Z(1,C.IMenuManagerService),Z(2,o.Inject(C.ComponentManager))],L);var je=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Ae=(e,t,r,n)=>{for(var i=n>1?void 0:n?we(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&je(t,r,i),i},R=(e,t)=>(r,n)=>t(r,n,e);let z=class extends o.Disposable{constructor(e,t,r,n,i,s,d){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=r,this._docRenderController=n,this._univerInstanceService=i,this._threadCommentModel=s,this._commandService=d,this._interceptorViewModel(),this._initReRender(),this._initSyncComments()}_initReRender(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var r;if(e){this._docRenderController.reRender(e.unitId);return}const t=(r=this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC))==null?void 0:r.getUnitId();t&&this._docRenderController.reRender(t)})),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{e.type==="resolve"&&this._docRenderController.reRender(e.unitId)}))}_interceptorViewModel(){this._docInterceptorService.intercept(M.DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION,{handler:(e,t,r)=>{if(!e)return r(e);const{unitId:n,index:i,customDecorations:s}=t,d=this._threadCommentPanelService.activeCommentId,{commentId:a,unitId:v}=d||{},h=s.find(p=>p.id===a),m=this._threadCommentModel.getComment(n,y,e.id);if(!m)return r({...e,show:!1});const _=h&&i>=h.startIndex&&i<=h.endIndex,S=v===n&&e.id===a;return r({...e,active:S||_,show:!m.resolved})}})}_initSyncComments(){var i,s,d;const e=this._context.unit.getUnitId(),t=y,r=(d=(s=(i=this._context.unit.getBody())==null?void 0:i.customDecorations)==null?void 0:s.filter(a=>a.type===o.CustomDecorationType.COMMENT).map(a=>a.id))!=null?d:[];r.forEach(a=>{this._threadCommentModel.getComment(e,t,a)||this._threadCommentModel.addComment(e,t,{id:a,threadId:a,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),r.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),y,r);let n=r.sort();this.disposeWithMe(this._commandService.onCommandExecuted(a=>{var v,h,m;if(a.id===M.RichTextEditingMutation.id){if(a.params.unitId!==this._context.unit.getUnitId())return;const S=(m=(h=(v=this._context.unit.getBody())==null?void 0:v.customDecorations)==null?void 0:h.filter(l=>l.type===o.CustomDecorationType.COMMENT).map(l=>l.id))!=null?m:[],p=S.sort();if(JSON.stringify(n)!==JSON.stringify(p)){const l=new Set(n),u=new Set(p),D=new Set,E=new Set;S.forEach(f=>{l.has(f)||D.add(f)}),n.forEach(f=>{u.has(f)||E.add(f)}),n=p,D.forEach(f=>{this._threadCommentModel.getComment(e,t,f)||this._threadCommentModel.addComment(e,t,{id:f,threadId:f,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),this._threadCommentModel.syncThreadComments(e,t,[...D])}}}))}};z=Ae([R(1,o.Inject(M.DocInterceptorService)),R(2,o.Inject(T.ThreadCommentPanelService)),R(3,o.Inject(j.DocRenderController)),R(4,o.IUniverInstanceService),R(5,o.Inject(w.ThreadCommentModel)),R(6,o.ICommandService)],z);var ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ve=(e,t,r)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$e=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ne(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ie(t,r,i),i},J=(e,t)=>(r,n)=>t(r,n,e),oe=(e,t,r)=>Ve(e,typeof t!="symbol"?t+"":t,r);c.UniverDocsThreadCommentUIPlugin=class extends o.Plugin{constructor(t=ae,r,n,i){super(),this._config=t,this._injector=r,this._renderManagerSrv=n,this._configService=i;const{menu:s,...d}=this._config;s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(de,d)}onStarting(){[[L],[F],[U]].forEach(t=>{this._injector.add(t)})}onRendered(){this._initRenderModule(),this._injector.get(F),this._injector.get(L)}_initRenderModule(){[z].forEach(t=>{this._renderManagerSrv.registerRenderModule(o.UniverInstanceType.UNIVER_DOC,t)})}},oe(c.UniverDocsThreadCommentUIPlugin,"pluginName",se),oe(c.UniverDocsThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_DOC),c.UniverDocsThreadCommentUIPlugin=$e([o.DependentOn(T.UniverThreadCommentUIPlugin),J(1,o.Inject(o.Injector)),J(2,g.IRenderManagerService),J(3,o.IConfigService)],c.UniverDocsThreadCommentUIPlugin),c.AddDocCommentComment=W,c.DeleteDocCommentComment=K,c.ShowCommentPanelOperation=N,c.StartAddCommentOperation=V,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
24
|
+
*/var ee;function ve(){if(ee)return N;ee=1;var e=O,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function d(a,m,f){var c,C={},p=null,_=null;f!==void 0&&(p=""+f),m.key!==void 0&&(p=""+m.key),m.ref!==void 0&&(_=m.ref);for(c in m)n.call(m,c)&&!s.hasOwnProperty(c)&&(C[c]=m[c]);if(a&&a.defaultProps)for(c in m=a.defaultProps,m)C[c]===void 0&&(C[c]=m[c]);return{$$typeof:t,type:a,key:p,ref:_,props:C,_owner:i.current}}return N.Fragment=r,N.jsx=d,N.jsxs=d,N}var te;function fe(){return te||(te=1,W.exports=ve()),W.exports}var he=fe();const J={id:"docs.command.add-comment",type:o.CommandType.COMMAND,async handler(e,t){if(!t)return!1;const{comment:r,unitId:n}=t,s=await e.get(w.IThreadCommentDataSourceService).addComment(r),d=e.get(o.ICommandService),a=j.addCustomDecorationBySelectionFactory(e,{id:s.threadId,type:o.CustomDecorationType.COMMENT});if(a){const m={id:w.AddCommentMutation.id,params:{unitId:n,subUnitId:D,comment:s}},f={id:T.SetActiveCommentOperation.id,params:{unitId:n,subUnitId:D,commentId:s.id}};return(await o.sequenceExecute([m,a,f],d)).result}return!1}},K={id:"docs.command.delete-comment",type:o.CommandType.COMMAND,async handler(e,t){if(!t)return!1;const{commentId:r,unitId:n}=t,i=e.get(o.ICommandService),s=j.deleteCustomDecorationFactory(e,{id:r,unitId:n});return s?(await o.sequenceExecute([s],i)).result:!1}},ne=e=>{const t=e.get(g.IRenderManagerService),r=e.get(M.DocSelectionManagerService),n=t.getCurrent(),i=n==null?void 0:n.with(M.DocSkeletonManagerService).getSkeleton(),s=i==null?void 0:i.getViewModel().getEditArea();if(s===g.DocumentEditArea.FOOTER||s===g.DocumentEditArea.HEADER)return!0;const d=r.getActiveTextRange();return!!(d==null||d.collapsed)};function Ce(e){return{id:$.id,type:I.MenuItemType.BUTTON,icon:"CommentSingle",title:"threadCommentUI.panel.addComment",tooltip:"threadCommentUI.panel.addComment",hidden$:I.getMenuHiddenObservable(e,o.UniverInstanceType.UNIVER_DOC,void 0,o.SHEET_EDITOR_UNITS),disabled$:new A.Observable(function(t){const n=e.get(M.DocSelectionManagerService).textSelection$.pipe(A.debounceTime(16)).subscribe(()=>{t.next(ne(e))});return()=>{n.unsubscribe()}})}}function pe(e){return{id:q.id,type:I.MenuItemType.BUTTON,icon:"CommentSingle",title:"threadCommentUI.panel.addComment",tooltip:"threadCommentUI.panel.addComment",hidden$:I.getMenuHiddenObservable(e,o.UniverInstanceType.UNIVER_DOC)}}const R=()=>{const e=o.useDependency(o.IUniverInstanceService),t=o.useDependency(o.Injector),r=O.useMemo(()=>e.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_DOC),[e]),n=o.useObservable(r),i=O.useMemo(()=>new A.Observable(u=>u.next(D)),[]),s=o.useDependency(M.DocSelectionManagerService),d=O.useMemo(()=>s.textSelection$.pipe(A.debounceTime(16)),[s.textSelection$]);o.useObservable(d);const a=o.useDependency(o.ICommandService),m=o.useDependency(U),f=o.useObservable(m.addingComment$),[c,C]=O.useState([]);if(O.useEffect(()=>{var E;const u=new Set,v=n==null?void 0:n.getCustomDecorations();C((E=v==null?void 0:v.map(h=>h.id).filter(h=>{const b=u.has(h);return u.add(h),!b}))!=null?E:[]);const y=a.onCommandExecuted(h=>{var b;if(h.id===M.RichTextEditingMutation.id){const B=new Set,Y=n==null?void 0:n.getCustomDecorations();C((b=Y==null?void 0:Y.map(L=>L.id).filter(L=>{const Ne=B.has(L);return B.add(L),!Ne}))!=null?b:[])}});return()=>{y.dispose()}},[a,n]),!n)return null;const p=ne(t),_=n.getUnitId();return he.jsx(T.ThreadCommentPanel,{unitId:_,subUnitId$:i,type:o.UniverInstanceType.UNIVER_DOC,onAdd:()=>{a.executeCommand($.id)},getSubUnitName:()=>"",disableAdd:p,tempComment:f,onAddComment:u=>{if(!u.parentId){const v={unitId:_,range:f,comment:u};return a.executeCommand(J.id,v),m.endAdd(),!1}return!0},onDeleteComment:u=>{if(!u.parentId){const v={unitId:_,commentId:u.id};return a.executeCommand(K.id,v),!1}return!0},showComments:c})};R.componentKey="univer.doc.thread-comment-panel";const V={id:"docs.operation.show-comment-panel",type:o.CommandType.OPERATION,handler(e,t){var i;const r=e.get(T.ThreadCommentPanelService),n=e.get(I.ISidebarService);return(!r.panelVisible||((i=n.options.children)==null?void 0:i.label)!==R.componentKey)&&(n.open({header:{title:"threadCommentUI.panel.title"},children:{label:R.componentKey},width:320,onClose:()=>r.setPanelVisible(!1)}),r.setPanelVisible(!0)),t&&r.setActiveComment(t==null?void 0:t.activeComment),!0}},q={id:"docs.operation.toggle-comment-panel",type:o.CommandType.OPERATION,handler(e){var n;const t=e.get(T.ThreadCommentPanelService),r=e.get(I.ISidebarService);return!t.panelVisible||((n=r.options.children)==null?void 0:n.label)!==R.componentKey?(r.open({header:{title:"threadCommentUI.panel.title"},children:{label:R.componentKey},width:320,onClose:()=>t.setPanelVisible(!1)}),t.setPanelVisible(!0)):(r.close(),t.setPanelVisible(!1),t.setActiveComment(null)),!0}},$={id:"docs.operation.start-add-comment",type:o.CommandType.OPERATION,handler(e){var h,b,B;const t=e.get(T.ThreadCommentPanelService),n=e.get(o.IUniverInstanceService).getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC),i=e.get(M.DocSelectionManagerService),s=e.get(g.IRenderManagerService),d=e.get(o.UserManagerService),a=e.get(U),m=e.get(o.ICommandService),f=e.get(I.ISidebarService),c=i.getActiveTextRange();if(!n||!c)return!1;const C=(h=s.getRenderById(n.getUnitId()))==null?void 0:h.with(j.DocSelectionRenderService);if(c.collapsed)return t.panelVisible?(t.setPanelVisible(!1),f.close()):m.executeCommand(V.id),!0;m.executeCommand(V.id);const p=n.getUnitId(),_=((B=(b=n.getBody())==null?void 0:b.dataStream)!=null?B:"").slice(c.startOffset,c.endOffset),u=o.BuildTextUtils.transform.getPlainText(_),v=D,y="",E={unitId:p,subUnitId:v,id:y,ref:u,dT:w.getDT(),personId:d.getCurrentUser().userID,text:{dataStream:`\r
|
|
25
|
+
`},startOffset:c.startOffset,endOffset:c.endOffset,collapsed:!0,threadId:y};return C==null||C.blurEditor(),a.startAdd(E),t.setActiveComment({unitId:p,subUnitId:v,commentId:y}),!0}};var _e=Object.defineProperty,Ie=Object.getOwnPropertyDescriptor,Se=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ie(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&_e(t,r,i),i},x=(e,t)=>(r,n)=>t(r,n,e);let F=class extends o.Disposable{constructor(e,t,r,n,i,s){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=r,this._docThreadCommentService=n,this._renderManagerService=i,this._threadCommentModel=s,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var r,n,i,s;if(t.id===M.SetTextSelectionsOperation.id){const d=t.params,{unitId:a,ranges:m}=d,f=this._univerInstanceService.getUnit(a,o.UniverInstanceType.UNIVER_DOC),c=m[0];if((e==null?void 0:e.startOffset)===(c==null?void 0:c.startOffset)&&(e==null?void 0:e.endOffset)===(c==null?void 0:c.endOffset))return;if(e=c,c&&f){const{startOffset:C,endOffset:p,collapsed:_}=c;let u;if(_?u=(n=(r=f.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(v=>v.startIndex<=C&&v.endIndex>=p-1):u=(s=(i=f.getBody())==null?void 0:i.customDecorations)==null?void 0:s.find(v=>v.startIndex<=C&&v.endIndex>=p-1),u){const v=this._threadCommentModel.getComment(a,D,u.id);v&&!v.resolved&&this._commandService.executeCommand(V.id,{activeComment:{unitId:a,subUnitId:D,commentId:u.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;this._commandService.executeCommand(T.SetActiveCommentOperation.id)}}))}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t,r,n,i;if(e){const s=this._univerInstanceService.getUnit(e.unitId);if(s){const d=(t=this._renderManagerService.getRenderById(e.unitId))==null?void 0:t.with(j.DocBackScrollRenderController),a=(n=(r=s.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(m=>m.id===e.commentId);a&&d&&d.scrollToRange({startOffset:a.startIndex,endOffset:a.endIndex,collapsed:!1})}}(!e||e.commentId!==((i=this._docThreadCommentService.addingComment)==null?void 0:i.id))&&this._docThreadCommentService.endAdd()}))}};F=Se([x(0,o.Inject(T.ThreadCommentPanelService)),x(1,o.IUniverInstanceService),x(2,o.ICommandService),x(3,o.Inject(U)),x(4,g.IRenderManagerService),x(5,o.Inject(w.ThreadCommentModel))],F);var S=function(){return S=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},S.apply(this,arguments)},ge=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},re=O.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,s=e.extend,d=ge(e,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),m=O.useRef("_".concat(Me()));return ie(r,"".concat(n),{defIds:r.defIds,idSuffix:m.current},S({ref:t,className:a},d),s)});function ie(e,t,r,n,i){return O.createElement(e.tag,S(S({key:t},Oe(e,r,i)),n),(Te(e,r).children||[]).map(function(s,d){return ie(s,"".concat(t,"-").concat(e.tag,"-").concat(d),r,void 0,i)}))}function Oe(e,t,r){var n=S({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(s){var d=s[0],a=s[1];typeof a=="string"&&(n[d]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function Te(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?S(S({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?S(S({},i),{attrs:S(S({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function Me(){return Math.random().toString(36).substring(2,8)}re.displayName="UniverIcon";var De={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},oe=O.forwardRef(function(e,t){return O.createElement(re,Object.assign({},e,{id:"comment-single",ref:t,icon:De}))});oe.displayName="CommentSingle";const ye={[I.RibbonStartGroup.OTHERS]:{[q.id]:{order:1,menuItemFactory:pe}},[I.ContextMenuPosition.MAIN_AREA]:{[I.ContextMenuGroup.DATA]:{[$.id]:{order:1,menuItemFactory:Ce}}}};var be=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,Re=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ue(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&be(t,r,i),i},G=(e,t)=>(r,n)=>t(r,n,e);let H=class extends o.Disposable{constructor(e,t,r){super(),this._commandService=e,this._menuManagerService=t,this._componentManager=r,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[J,K,V,$,q].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(ye)}_initComponents(){[R].forEach(e=>{this.disposeWithMe(this._componentManager.register(e.componentKey,e))}),this.disposeWithMe(this._componentManager.register("CommentSingle",oe))}};H=Re([G(0,o.ICommandService),G(1,I.IMenuManagerService),G(2,o.Inject(I.ComponentManager))],H);var xe=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,Ee=(e,t,r,n)=>{for(var i=n>1?void 0:n?Pe(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&xe(t,r,i),i},P=(e,t)=>(r,n)=>t(r,n,e);let Z=class extends o.Disposable{constructor(e,t,r,n,i,s,d){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=r,this._docRenderController=n,this._univerInstanceService=i,this._threadCommentModel=s,this._commandService=d,this._interceptorViewModel(),this._initReRender(),this._initSyncComments()}_initReRender(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var r;if(e){this._docRenderController.reRender(e.unitId);return}const t=(r=this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC))==null?void 0:r.getUnitId();t&&this._docRenderController.reRender(t)})),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{e.type==="resolve"&&this._docRenderController.reRender(e.unitId)}))}_interceptorViewModel(){this._docInterceptorService.intercept(M.DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION,{handler:(e,t,r)=>{if(!e)return r(e);const{unitId:n,index:i,customDecorations:s}=t,d=this._threadCommentPanelService.activeCommentId,{commentId:a,unitId:m}=d||{},f=s.find(_=>_.id===a),c=this._threadCommentModel.getComment(n,D,e.id);if(!c)return r({...e,show:!1});const C=f&&i>=f.startIndex&&i<=f.endIndex,p=m===n&&e.id===a;return r({...e,active:p||C,show:!c.resolved})}})}_initSyncComments(){var i,s,d;const e=this._context.unit.getUnitId(),t=D,r=(d=(s=(i=this._context.unit.getBody())==null?void 0:i.customDecorations)==null?void 0:s.filter(a=>a.type===o.CustomDecorationType.COMMENT).map(a=>a.id))!=null?d:[];r.forEach(a=>{this._threadCommentModel.getComment(e,t,a)||this._threadCommentModel.addComment(e,t,{id:a,threadId:a,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),r.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),D,r);let n=r.sort();this.disposeWithMe(this._commandService.onCommandExecuted(a=>{var m,f,c;if(a.id===M.RichTextEditingMutation.id){if(a.params.unitId!==this._context.unit.getUnitId())return;const p=(c=(f=(m=this._context.unit.getBody())==null?void 0:m.customDecorations)==null?void 0:f.filter(u=>u.type===o.CustomDecorationType.COMMENT).map(u=>u.id))!=null?c:[],_=p.sort();if(JSON.stringify(n)!==JSON.stringify(_)){const u=new Set(n),v=new Set(_),y=new Set,E=new Set;p.forEach(h=>{u.has(h)||y.add(h)}),n.forEach(h=>{v.has(h)||E.add(h)}),n=_,y.forEach(h=>{this._threadCommentModel.getComment(e,t,h)||this._threadCommentModel.addComment(e,t,{id:h,threadId:h,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),this._threadCommentModel.syncThreadComments(e,t,[...y])}}}))}};Z=Ee([P(1,o.Inject(M.DocInterceptorService)),P(2,o.Inject(T.ThreadCommentPanelService)),P(3,o.Inject(j.DocRenderController)),P(4,o.IUniverInstanceService),P(5,o.Inject(w.ThreadCommentModel)),P(6,o.ICommandService)],Z);var se=Object.defineProperty,je=Object.getOwnPropertyDescriptor,we=(e,t,r)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ae=(e,t,r,n)=>{for(var i=n>1?void 0:n?je(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&se(t,r,i),i},z=(e,t)=>(r,n)=>t(r,n,e),de=(e,t,r)=>we(e,typeof t!="symbol"?t+"":t,r);l.UniverDocsThreadCommentUIPlugin=class extends o.Plugin{constructor(t=X,r,n,i){super(),this._config=t,this._injector=r,this._renderManagerSrv=n,this._configService=i;const{menu:s,...d}=o.merge({},X,this._config);s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(ce,d)}onStarting(){[[H],[F],[U]].forEach(t=>{this._injector.add(t)})}onRendered(){this._initRenderModule(),this._injector.get(F),this._injector.get(H)}_initRenderModule(){[Z].forEach(t=>{this._renderManagerSrv.registerRenderModule(o.UniverInstanceType.UNIVER_DOC,t)})}},de(l.UniverDocsThreadCommentUIPlugin,"pluginName",ae),de(l.UniverDocsThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_DOC),l.UniverDocsThreadCommentUIPlugin=Ae([o.DependentOn(T.UniverThreadCommentUIPlugin),z(1,o.Inject(o.Injector)),z(2,g.IRenderManagerService),z(3,o.IConfigService)],l.UniverDocsThreadCommentUIPlugin),l.AddDocCommentComment=J,l.DeleteDocCommentComment=K,l.ShowCommentPanelOperation=V,l.StartAddCommentOperation=$,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
// @univerjs-pro/thread-comment-datasource/index
|
|
29
|
-
function _0x7d39(){const _0x3de109=['error','876wUumos','add','/solved','_userService','post','_threadCommentDataSourceService','rangeId','solved','UniverProCollaborationClient','_init','8HlcAUt','personId','stringify','length','4791vjeJOZ','rxjs','parse','size','19070IyPlUE','getMemberID','symbol','amd','@univerjs/network','find','@univerjs/core','resolveComment','_initUserSync','CustomRangeType','_threadCommentDataSource','UserManagerService','exports','HTTPService','defineProperty','/universer-api/user/list','values','code','CollaborationSessionService','Edit','OpenOrReOpen','object','/list','11547nzSoYl','Solve','ThreadCommentModel','parentId','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','28554sXyLLa','requireSession','UniverProThreadCommentDatasource','@univerjs-pro/collaboration-client','Solved','addComment','replies','format','type','Plugin','UNRECOGNIZED','IThreadCommentDataSourceService','Add','/reply','_initDataSource','rangeType','502968DNUTip','slice','getUnit','_sessionService','get','syncUpdateMutationToColla','user','CommentService','_config','1149323mJkcSN','root','delete','Inject','UniverThreadCommentUIPlugin','threadId','getComment','map','setConfig','COMMENT','1073196HWXdsE','createTimestamp','@univerjs/thread-comment','UniverThreadComment','UniverCore','UniverProLicense','disposeWithMe','reply','addUser','UniverThreadCommentDataSourcePlugin','getUser','_threadCommentModel','getOwnPropertyDescriptor','onStarting','userID','Unknown','dataSource','content','users','/edit','YYYY/MM/DD\x20HH:mm','@univerjs/thread-comment-ui','UniverCollaborationClientPlugin','comments','body','_injector','onReady','_httpService','deleteComment','unitId','filter','UniverNetwork','forEach','userId','@univerjs-pro/license','dayjs','Delete','Injector','3114975QnSaiX','customRanges','/universer-api/comment/unit/','comment','Reply','updateComment','replyId','UniverLicensePlugin','pluginName','listComments','saveCommentToSnapshot','/add','subscribe','/delete','Disposable'];_0x7d39=function(){return _0x3de109;};return _0x7d39();}function _0x44c8(_0x2351ea,_0x48dcd2){const _0x7d3908=_0x7d39();return _0x44c8=function(_0x44c8a9,_0x2a1126){_0x44c8a9=_0x44c8a9-0xb9;let _0x3c93ef=_0x7d3908[_0x44c8a9];return _0x3c93ef;},_0x44c8(_0x2351ea,_0x48dcd2);}(function(_0x469347,_0x357ec6){const _0xf65cc=_0x44c8,_0x3cd131=_0x469347();while(!![]){try{const _0x3fdb83=-parseInt(_0xf65cc(0xd0))/0x1+-parseInt(_0xf65cc(0xf3))/0x2+parseInt(_0xf65cc(0x137))/0x3*(-parseInt(_0xf65cc(0x129))/0x4)+-parseInt(_0xf65cc(0x119))/0x5+-parseInt(_0xf65cc(0xe0))/0x6+parseInt(_0xf65cc(0xe9))/0x7*(-parseInt(_0xf65cc(0x133))/0x8)+parseInt(_0xf65cc(0xcb))/0x9*(parseInt(_0xf65cc(0x13b))/0xa);if(_0x3fdb83===_0x357ec6)break;else _0x3cd131['push'](_0x3cd131['shift']());}catch(_0x4ff261){_0x3cd131['push'](_0x3cd131['shift']());}}}(_0x7d39,0xa1526),function(_0x4a2b8a,_0x32b02c){const _0x441ad2=_0x44c8;typeof exports==_0x441ad2(0xc9)&&typeof module<'u'?_0x32b02c(exports,require('@univerjs/core'),require(_0x441ad2(0x108)),require(_0x441ad2(0xd3)),require(_0x441ad2(0x115)),require('@univerjs/thread-comment'),require(_0x441ad2(0x138)),require(_0x441ad2(0x13f))):typeof define=='function'&&define[_0x441ad2(0x13e)]?define([_0x441ad2(0xc0),_0x441ad2(0xba),'@univerjs/thread-comment-ui',_0x441ad2(0xd3),_0x441ad2(0x115),_0x441ad2(0xf5),_0x441ad2(0x138),'@univerjs/network'],_0x32b02c):(_0x4a2b8a=typeof globalThis<'u'?globalThis:_0x4a2b8a||self,_0x32b02c(_0x4a2b8a[_0x441ad2(0xd2)]={},_0x4a2b8a[_0x441ad2(0xf7)],_0x4a2b8a['UniverThreadCommentUi'],_0x4a2b8a[_0x441ad2(0x131)],_0x4a2b8a[_0x441ad2(0xf8)],_0x4a2b8a[_0x441ad2(0xf6)],_0x4a2b8a[_0x441ad2(0x138)],_0x4a2b8a[_0x441ad2(0x112)]));}(this,function(_0x192ce3,_0xf4f67d,_0x254044,_0x27eb00,_0x535dd6,_0x32d206,_0x56bc4f,_0x331a66){'use strict';const _0x5aeff8=_0x44c8;const _0xc1db27=_0x5aeff8(0xcf);var _0x5c92fb=(_0x392d9f=>(_0x392d9f[_0x392d9f[_0x5aeff8(0xc8)]=0x0]=_0x5aeff8(0xc8),_0x392d9f[_0x392d9f[_0x5aeff8(0xd4)]=0x1]=_0x5aeff8(0xd4),_0x392d9f[_0x392d9f['UNRECOGNIZED']=-0x1]=_0x5aeff8(0xda),_0x392d9f))(_0x5c92fb||{}),_0x476594=(_0x5eb5bb=>(_0x5eb5bb[_0x5eb5bb['Unknown']=0x0]=_0x5aeff8(0x102),_0x5eb5bb[_0x5eb5bb[_0x5aeff8(0xdc)]=0x1]='Add',_0x5eb5bb[_0x5eb5bb[_0x5aeff8(0x11d)]=0x2]=_0x5aeff8(0x11d),_0x5eb5bb[_0x5eb5bb['Edit']=0x3]=_0x5aeff8(0xc7),_0x5eb5bb[_0x5eb5bb[_0x5aeff8(0x117)]=0x4]=_0x5aeff8(0x117),_0x5eb5bb[_0x5eb5bb[_0x5aeff8(0xcc)]=0x5]=_0x5aeff8(0xcc),_0x5eb5bb[_0x5eb5bb[_0x5aeff8(0xda)]=-0x1]=_0x5aeff8(0xda),_0x5eb5bb))(_0x476594||{});const _0x576504=_0x4e6f03=>_0xf4f67d[_0x5aeff8(0x116)](new Date(+_0x4e6f03))[_0x5aeff8(0xd7)](_0x5aeff8(0x107)),_0x195dbc=async(_0x56bfeb,_0x9fde91)=>{const _0x17345d=_0x5aeff8,_0x51f734=_0x56bfeb[_0x17345d(0xe4)](_0xf4f67d[_0x17345d(0xbf)]),_0x4cf4b9=_0x56bfeb['get'](_0x331a66[_0x17345d(0xc1)]);_0x9fde91[_0x17345d(0x113)](_0x5214a9=>{const _0x3b9143=_0x17345d;_0x51f734[_0x3b9143(0xfd)](_0x5214a9)&&_0x9fde91[_0x3b9143(0xeb)](_0x5214a9);}),_0x9fde91[_0x17345d(0x13a)]&&(await _0x4cf4b9[_0x17345d(0xe4)](_0x17345d(0xc3),{'params':{'userIDs':[..._0x9fde91]}}))[_0x17345d(0x10b)][_0x17345d(0x105)][_0x17345d(0x113)](_0x92e85f=>{const _0x19139a=_0x17345d;_0x92e85f&&_0x51f734[_0x19139a(0xfb)](_0x92e85f);});};var _0x1184be=Object[_0x5aeff8(0xc2)],_0x32a0a7=Object[_0x5aeff8(0xff)],_0x208816=(_0x15a9b0,_0x5092c5,_0x129ab5,_0x375558)=>{const _0x2a541f=_0x5aeff8;for(var _0x5bbbbc=_0x375558>0x1?void 0x0:_0x375558?_0x32a0a7(_0x5092c5,_0x129ab5):_0x5092c5,_0x43397d=_0x15a9b0[_0x2a541f(0x136)]-0x1,_0x534181;_0x43397d>=0x0;_0x43397d--)(_0x534181=_0x15a9b0[_0x43397d])&&(_0x5bbbbc=(_0x375558?_0x534181(_0x5092c5,_0x129ab5,_0x5bbbbc):_0x534181(_0x5bbbbc))||_0x5bbbbc);return _0x375558&&_0x5bbbbc&&_0x1184be(_0x5092c5,_0x129ab5,_0x5bbbbc),_0x5bbbbc;},_0x4029b5=(_0x30defd,_0x198a32)=>(_0x1bc6ae,_0x535ae6)=>_0x198a32(_0x1bc6ae,_0x535ae6,_0x30defd);let _0x45c1c8=class extends _0xf4f67d[_0x5aeff8(0x127)]{constructor(_0x3860f8,_0x242088,_0x42b8d5,_0x43bb00){const _0x3a7274=_0x5aeff8;super(),this['_commentService']=_0x3860f8,this[_0x3a7274(0xfe)]=_0x242088,this[_0x3a7274(0x12c)]=_0x42b8d5,this[_0x3a7274(0x10c)]=_0x43bb00,this[_0x3a7274(0x132)](),this['_initUserSync']();}[_0x5aeff8(0xbc)](){const _0x2e19e1=_0x5aeff8;this[_0x2e19e1(0xf9)](this[_0x2e19e1(0xfe)]['commentUpdate$']['pipe'](_0x56bc4f['bufferTime'](0x10))['subscribe'](_0x7b6b81=>{const _0x4f0ebe=_0x2e19e1,_0x27f3d6=new Set();_0x7b6b81[_0x4f0ebe(0x113)](_0x4cba9f=>{const _0x5baec4=_0x4f0ebe;switch(_0x4cba9f[_0x5baec4(0xd8)]){case _0x5baec4(0x12a):{const _0x18b431=_0x4cba9f['payload'][_0x5baec4(0x134)];_0x27f3d6['add'](_0x18b431);break;}}}),_0x195dbc(this[_0x4f0ebe(0x10c)],_0x27f3d6);}));}[_0x5aeff8(0x132)](){const _0x57441f=_0x5aeff8;this[_0x57441f(0xf9)](this['_commentService']['commentUpdate$'][_0x57441f(0x125)](async _0x167e96=>{const _0x205f91=_0x57441f;var _0x3ade61,_0x53f6d8,_0x2569d3,_0x203555;const _0x28656a=(_0x3ade61=this[_0x205f91(0xfe)][_0x205f91(0xe2)](_0x167e96[_0x205f91(0x110)])[_0x205f91(0xb9)](_0x1a2a63=>_0x1a2a63['threadId']===_0x167e96[_0x205f91(0xee)]))==null?void 0x0:_0x3ade61['root'];if(!_0x28656a)return;const {unitId:_0x97bc10,subUnitId:_0x50f39c}=_0x28656a;switch(_0x167e96['user']&&this[_0x205f91(0x12c)][_0x205f91(0xfb)](_0x167e96[_0x205f91(0xe6)]),_0x167e96[_0x205f91(0xd8)]){case _0x476594[_0x205f91(0xdc)]:break;case _0x476594[_0x205f91(0x11d)]:{this[_0x205f91(0xfe)][_0x205f91(0xd5)](_0x97bc10,_0x50f39c,{'unitId':_0x97bc10,'subUnitId':_0x50f39c,'ref':'','id':_0x167e96[_0x205f91(0x11f)],'dT':_0x576504(+_0x167e96['createTimestamp']),'threadId':_0x167e96[_0x205f91(0xee)],'personId':(_0x2569d3=(_0x53f6d8=_0x167e96[_0x205f91(0xe6)])==null?void 0x0:_0x53f6d8['userID'])!=null?_0x2569d3:_0x167e96[_0x205f91(0x114)],'text':JSON['parse'](_0x167e96[_0x205f91(0x104)]),'parentId':_0x28656a['id']});break;}case _0x476594[_0x205f91(0x117)]:{const _0x4d1351=this[_0x205f91(0xfe)][_0x205f91(0xef)](_0x97bc10,_0x50f39c,_0x167e96['replyId']);_0x4d1351&&_0x4d1351[_0x205f91(0xce)]&&this[_0x205f91(0xfe)][_0x205f91(0x10f)](_0x97bc10,_0x50f39c,_0x167e96['replyId']);break;}case _0x476594['Edit']:{this['_threadCommentModel'][_0x205f91(0x11e)](_0x97bc10,_0x50f39c,{'commentId':_0x167e96[_0x205f91(0x11f)],'text':JSON[_0x205f91(0x139)](_0x167e96[_0x205f91(0x104)])});break;}case _0x476594[_0x205f91(0xcc)]:{const _0x1f72c9=(_0x203555=this[_0x205f91(0xfe)]['getUnit'](_0x167e96['unitId'])[_0x205f91(0xb9)](_0x172ab7=>_0x172ab7[_0x205f91(0xee)]===_0x167e96[_0x205f91(0xee)]))==null?void 0x0:_0x203555[_0x205f91(0xea)];_0x1f72c9&&this[_0x205f91(0xfe)][_0x205f91(0xbb)](_0x97bc10,_0x50f39c,_0x1f72c9['id'],_0x167e96['solved']===_0x5c92fb['Solved']);break;}}}));}};_0x45c1c8=_0x208816([_0x4029b5(0x0,_0xf4f67d[_0x5aeff8(0xec)](_0x27eb00[_0x5aeff8(0xe7)])),_0x4029b5(0x1,_0xf4f67d[_0x5aeff8(0xec)](_0x32d206[_0x5aeff8(0xcd)])),_0x4029b5(0x2,_0xf4f67d[_0x5aeff8(0xec)](_0xf4f67d['UserManagerService'])),_0x4029b5(0x3,_0xf4f67d[_0x5aeff8(0xec)](_0xf4f67d[_0x5aeff8(0x118)]))],_0x45c1c8);const _0x2e3a69='thread-comment-data-source.config',_0x35b116={};var _0x3d1511=Object[_0x5aeff8(0xc2)],_0xb4946d=Object['getOwnPropertyDescriptor'],_0x2aa8e8=(_0x40c2fe,_0x1b28d3,_0x37b6b5,_0x553b9d)=>{const _0x726920=_0x5aeff8;for(var _0x6bbf1d=_0x553b9d>0x1?void 0x0:_0x553b9d?_0xb4946d(_0x1b28d3,_0x37b6b5):_0x1b28d3,_0x316ceb=_0x40c2fe[_0x726920(0x136)]-0x1,_0x3931ce;_0x316ceb>=0x0;_0x316ceb--)(_0x3931ce=_0x40c2fe[_0x316ceb])&&(_0x6bbf1d=(_0x553b9d?_0x3931ce(_0x1b28d3,_0x37b6b5,_0x6bbf1d):_0x3931ce(_0x6bbf1d))||_0x6bbf1d);return _0x553b9d&&_0x6bbf1d&&_0x3d1511(_0x1b28d3,_0x37b6b5,_0x6bbf1d),_0x6bbf1d;},_0x396cd8=(_0x3f5471,_0x359e90)=>(_0x5b7a46,_0x163760)=>_0x359e90(_0x5b7a46,_0x163760,_0x3f5471);function _0x44a8ec(_0x44cf7c,_0x1abb54){const _0x255a0f=_0x5aeff8,_0x177c31=_0x44cf7c['replies'][0x0];return{..._0x1abb54,'id':_0x177c31['replyId'],'resolved':_0x44cf7c[_0x255a0f(0x130)]===0x1,'dT':_0x576504(_0x177c31[_0x255a0f(0xf4)]),'personId':_0x177c31['userId'],'threadId':_0x177c31[_0x255a0f(0xee)]};}function _0x1e4d72(_0x3e86a7,_0x50eee2,_0x45a3ef){const _0x15b4f0=_0x5aeff8;var _0x2ece5a,_0x72e5eb;if(((_0x72e5eb=(_0x2ece5a=_0x3e86a7==null?void 0x0:_0x3e86a7[_0x15b4f0(0xd6)])==null?void 0x0:_0x2ece5a['length'])!=null?_0x72e5eb:0x0)>0x0){const _0xa8bed=(_0x27e631,_0x43faf6)=>({'id':_0x27e631[_0x15b4f0(0x11f)],'threadId':_0x27e631[_0x15b4f0(0xee)],'dT':_0x576504(_0x27e631[_0x15b4f0(0xf4)]),'personId':_0x27e631[_0x15b4f0(0x114)],'resolved':_0x3e86a7[_0x15b4f0(0x130)]===_0x5c92fb[_0x15b4f0(0xd4)],'unitId':_0x50eee2,'subUnitId':_0x45a3ef,'text':JSON['parse'](_0x27e631[_0x15b4f0(0x104)]),'parentId':_0x43faf6}),_0x4be7f8=_0xa8bed(_0x3e86a7[_0x15b4f0(0xd6)][0x0]);return{..._0x4be7f8,'children':_0x3e86a7['replies'][_0x15b4f0(0xe1)](0x1)[_0x15b4f0(0xf0)](_0x456ace=>_0xa8bed(_0x456ace,_0x4be7f8['id']))};}return null;}let _0x5e5b96=class{constructor(_0x12ac92,_0x2546db,_0x412f3f,_0xa95d71){const _0x2fc1c9=_0x5aeff8;this[_0x2fc1c9(0x10e)]=_0x12ac92,this[_0x2fc1c9(0x12c)]=_0x2546db,this[_0x2fc1c9(0xe3)]=_0x412f3f,this[_0x2fc1c9(0x10c)]=_0xa95d71;}async[_0x5aeff8(0xd5)](_0x5d7d43){const _0x374c82=_0x5aeff8;var _0x65ccc5,_0x10df3c;const {parentId:_0x5eceb5,unitId:_0x36d314,text:_0x46ddd5,threadId:_0x37110b}=_0x5d7d43,_0x4886fb=(_0x10df3c=(_0x65ccc5=_0x46ddd5['customRanges'])==null?void 0x0:_0x65ccc5[_0x374c82(0x111)](_0x2a396e=>_0x2a396e[_0x374c82(0xdf)]===_0xf4f67d[_0x374c82(0xbd)][_0x374c82(0xf2)])['map'](_0x33f5d8=>_0x33f5d8[_0x374c82(0x12f)]))!=null?_0x10df3c:[],_0x19ada9=JSON['stringify'](_0x46ddd5),_0x39bc5e=(await this['_sessionService'][_0x374c82(0xd1)](_0x36d314))[_0x374c82(0x13c)]();if(_0x5eceb5){const _0x53c62a={'memberId':_0x39bc5e,'unitId':_0x36d314,'content':_0x19ada9,'mention':_0x4886fb,'threadId':_0x37110b},_0x52b75c=(await this['_httpService'][_0x374c82(0x12d)](_0x374c82(0x11b)+_0x36d314+_0x374c82(0xdd),{'body':_0x53c62a}))[_0x374c82(0x10b)][_0x374c82(0xfa)];return{..._0x5d7d43,'id':_0x52b75c[_0x374c82(0x11f)],'dT':_0xf4f67d['dayjs'](+_0x52b75c['createTimestamp'])[_0x374c82(0xd7)](_0x374c82(0x107)),'personId':_0x52b75c[_0x374c82(0x114)]};}else{const _0x3cb3bf={'memberId':_0x39bc5e,'unitId':_0x36d314,'content':_0x19ada9,'mention':_0x4886fb},_0x3a29f1=await this[_0x374c82(0x10e)][_0x374c82(0x12d)](_0x374c82(0x11b)+_0x36d314+_0x374c82(0x124),{'body':_0x3cb3bf});return _0x44a8ec(_0x3a29f1['body'][_0x374c82(0x11c)],_0x5d7d43);}}async[_0x5aeff8(0x11e)](_0x220c0d){const _0x2e2794=_0x5aeff8;var _0x3293c9,_0x1e8292;const {text:_0x4219e3,unitId:_0x5db17f}=_0x220c0d,_0x3044dc=(_0x1e8292=(_0x3293c9=_0x4219e3[_0x2e2794(0x11a)])==null?void 0x0:_0x3293c9['filter'](_0x377bf8=>_0x377bf8[_0x2e2794(0xdf)]===_0xf4f67d[_0x2e2794(0xbd)][_0x2e2794(0xf2)])[_0x2e2794(0xf0)](_0x81ea29=>_0x81ea29[_0x2e2794(0x12f)]))!=null?_0x1e8292:[],_0x65e11e=JSON[_0x2e2794(0x135)](_0x4219e3),_0x2b10b4=_0x220c0d['threadId'],_0x2b7fd7=_0x220c0d['id'],_0x1aa1f7={'memberId':(await this[_0x2e2794(0xe3)][_0x2e2794(0xd1)](_0x5db17f))[_0x2e2794(0x13c)](),'unitId':_0x5db17f,'threadId':_0x2b10b4,'mention':_0x3044dc,'content':_0x65e11e,'replyId':_0x2b7fd7},_0x1332f0=await this['_httpService'][_0x2e2794(0x12d)](_0x2e2794(0x11b)+_0x5db17f+_0x2e2794(0x106),{'body':_0x1aa1f7});return!_0x1332f0[_0x2e2794(0x10b)][_0x2e2794(0x128)]||_0x1332f0[_0x2e2794(0x10b)][_0x2e2794(0x128)][_0x2e2794(0xc5)]===0x1;}async[_0x5aeff8(0xbb)](_0xf9240d){const _0x35567f=_0x5aeff8,{unitId:_0x3689d8}=_0xf9240d,_0x415203=_0xf9240d[_0x35567f(0xee)],_0x4f6684={'memberId':this[_0x35567f(0x12c)]['getCurrentUser']()[_0x35567f(0x101)],'unitId':_0x3689d8,'threadId':_0x415203,'solved':_0xf9240d['resolved']?_0x5c92fb['Solved']:_0x5c92fb[_0x35567f(0xc8)]},_0x448be4=await this['_httpService']['post'](_0x35567f(0x11b)+_0x3689d8+_0x35567f(0x12b),{'body':_0x4f6684});return!_0x448be4[_0x35567f(0x10b)]['error']||_0x448be4[_0x35567f(0x10b)][_0x35567f(0x128)][_0x35567f(0xc5)]===0x1;}async[_0x5aeff8(0x10f)](_0x18c585,_0x2e5701,_0x342a78,_0x2849bd){const _0x123e3a=_0x5aeff8,_0x8f5aaa={'memberId':(await this[_0x123e3a(0xe3)][_0x123e3a(0xd1)](_0x18c585))[_0x123e3a(0x13c)](),'threadId':_0x342a78,'replyId':_0x2849bd,'unitId':_0x18c585},_0x28415f=await this[_0x123e3a(0x10e)][_0x123e3a(0x12d)](_0x123e3a(0x11b)+_0x18c585+_0x123e3a(0x126),{'body':_0x8f5aaa});return!_0x28415f[_0x123e3a(0x10b)][_0x123e3a(0x128)]||_0x28415f[_0x123e3a(0x10b)][_0x123e3a(0x128)]['code']===0x1;}async[_0x5aeff8(0x122)](_0x1db0c1,_0x4a3ff9,_0x206779){const _0x23a3d4=_0x5aeff8,_0x8cb771={'unitId':_0x1db0c1,'threadId':_0x206779},_0x181848=await this[_0x23a3d4(0x10e)][_0x23a3d4(0x12d)](_0x23a3d4(0x11b)+_0x1db0c1+_0x23a3d4(0xca),{'body':_0x8cb771}),_0x78646=_0x206779[_0x23a3d4(0xf0)](_0x3b2ace=>_0x1e4d72(_0x181848[_0x23a3d4(0x10b)][_0x23a3d4(0x10a)][_0x3b2ace],_0x1db0c1,_0x4a3ff9))[_0x23a3d4(0x111)](Boolean);return Object[_0x23a3d4(0xc4)](_0x181848[_0x23a3d4(0x10b)][_0x23a3d4(0x105)])[_0x23a3d4(0x113)](_0x5a5f4e=>{const _0x3394df=_0x23a3d4;this[_0x3394df(0x12c)][_0x3394df(0xfb)](_0x5a5f4e);}),_0x78646;}[_0x5aeff8(0x123)](_0x343f64){const _0x37bf03=_0x5aeff8;return{'id':_0x343f64['id'],'threadId':_0x343f64[_0x37bf03(0xee)],'ref':_0x343f64['ref']};}};_0x5e5b96=_0x2aa8e8([_0x396cd8(0x0,_0xf4f67d[_0x5aeff8(0xec)](_0x331a66[_0x5aeff8(0xc1)])),_0x396cd8(0x1,_0xf4f67d['Inject'](_0xf4f67d[_0x5aeff8(0xbf)])),_0x396cd8(0x2,_0xf4f67d[_0x5aeff8(0xec)](_0x27eb00[_0x5aeff8(0xc6)])),_0x396cd8(0x3,_0xf4f67d[_0x5aeff8(0xec)](_0xf4f67d[_0x5aeff8(0x118)]))],_0x5e5b96);var _0x1d13b9=Object[_0x5aeff8(0xc2)],_0x4ec1c8=Object[_0x5aeff8(0xff)],_0x5ec1e5=(_0x534ece,_0x30c4e0,_0x19d36e,_0x242597)=>{const _0x3a4742=_0x5aeff8;for(var _0x4e8c1a=_0x242597>0x1?void 0x0:_0x242597?_0x4ec1c8(_0x30c4e0,_0x19d36e):_0x30c4e0,_0x335cbe=_0x534ece[_0x3a4742(0x136)]-0x1,_0x4f6600;_0x335cbe>=0x0;_0x335cbe--)(_0x4f6600=_0x534ece[_0x335cbe])&&(_0x4e8c1a=(_0x242597?_0x4f6600(_0x30c4e0,_0x19d36e,_0x4e8c1a):_0x4f6600(_0x4e8c1a))||_0x4e8c1a);return _0x242597&&_0x4e8c1a&&_0x1d13b9(_0x30c4e0,_0x19d36e,_0x4e8c1a),_0x4e8c1a;},_0x38ecf5=(_0x493c9b,_0x192352)=>(_0x3e47b8,_0x148520)=>_0x192352(_0x3e47b8,_0x148520,_0x493c9b);let _0x33813d=class extends _0xf4f67d[_0x5aeff8(0x127)]{constructor(_0x404762,_0x5e6d38){const _0x7e4413=_0x5aeff8;super(),this[_0x7e4413(0x12e)]=_0x404762,this[_0x7e4413(0xbe)]=_0x5e6d38,this['_initDataSource']();}[_0x5aeff8(0xde)](){const _0x25b94d=_0x5aeff8;this[_0x25b94d(0x12e)][_0x25b94d(0x103)]=this[_0x25b94d(0xbe)],this[_0x25b94d(0x12e)][_0x25b94d(0xe5)]=!0x1;}};_0x33813d=_0x5ec1e5([_0x38ecf5(0x0,_0x32d206[_0x5aeff8(0xdb)]),_0x38ecf5(0x1,_0xf4f67d[_0x5aeff8(0xec)](_0x5e5b96))],_0x33813d);var _0x17c322=Object[_0x5aeff8(0xc2)],_0x20e5e8=Object[_0x5aeff8(0xff)],_0x43558e=(_0x3f2daa,_0x5ea24d,_0x1d1aa1)=>_0x5ea24d in _0x3f2daa?_0x17c322(_0x3f2daa,_0x5ea24d,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1d1aa1}):_0x3f2daa[_0x5ea24d]=_0x1d1aa1,_0x2926bb=(_0x5cceb2,_0x420987,_0x1e6aab,_0x5464b9)=>{const _0x3edca0=_0x5aeff8;for(var _0x1da13a=_0x5464b9>0x1?void 0x0:_0x5464b9?_0x20e5e8(_0x420987,_0x1e6aab):_0x420987,_0x522934=_0x5cceb2[_0x3edca0(0x136)]-0x1,_0x19d42b;_0x522934>=0x0;_0x522934--)(_0x19d42b=_0x5cceb2[_0x522934])&&(_0x1da13a=(_0x5464b9?_0x19d42b(_0x420987,_0x1e6aab,_0x1da13a):_0x19d42b(_0x1da13a))||_0x1da13a);return _0x5464b9&&_0x1da13a&&_0x17c322(_0x420987,_0x1e6aab,_0x1da13a),_0x1da13a;},_0x58c35d=(_0x3d3f99,_0x1a3eb3)=>(_0x5298d4,_0x114857)=>_0x1a3eb3(_0x5298d4,_0x114857,_0x3d3f99),_0x11b0bb=(_0x200955,_0x46be30,_0x23348c)=>_0x43558e(_0x200955,typeof _0x46be30!=_0x5aeff8(0x13d)?_0x46be30+'':_0x46be30,_0x23348c);_0x192ce3[_0x5aeff8(0xfc)]=class extends _0xf4f67d[_0x5aeff8(0xd9)]{constructor(_0x2553ef=_0x35b116,_0x1dd615,_0x155c76){const _0x14c0e0=_0x5aeff8;super(),this['_config']=_0x2553ef,this[_0x14c0e0(0x10c)]=_0x1dd615,this['_configService']=_0x155c76;const {..._0xe04405}=this[_0x14c0e0(0xe8)];this['_configService'][_0x14c0e0(0xf1)](_0x2e3a69,_0xe04405);}[_0x5aeff8(0x100)](){const _0x4f2e66=_0x5aeff8;[[_0x5e5b96],[_0x33813d],[_0x45c1c8]][_0x4f2e66(0x113)](_0x2519ed=>{this['_injector']['add'](_0x2519ed);});}[_0x5aeff8(0x10d)](){const _0x12bf43=_0x5aeff8;this[_0x12bf43(0x10c)][_0x12bf43(0xe4)](_0x33813d),this[_0x12bf43(0x10c)]['get'](_0x45c1c8);}},_0x11b0bb(_0x192ce3[_0x5aeff8(0xfc)],_0x5aeff8(0x121),_0xc1db27),_0x11b0bb(_0x192ce3[_0x5aeff8(0xfc)],'type',_0xf4f67d['UniverInstanceType']['UNIVER_UNKNOWN']),_0x192ce3[_0x5aeff8(0xfc)]=_0x2926bb([_0xf4f67d['DependentOn'](_0x254044[_0x5aeff8(0xed)],_0x27eb00[_0x5aeff8(0x109)],_0x535dd6[_0x5aeff8(0x120)]),_0x58c35d(0x1,_0xf4f67d[_0x5aeff8(0xec)](_0xf4f67d[_0x5aeff8(0x118)])),_0x58c35d(0x2,_0xf4f67d['IConfigService'])],_0x192ce3[_0x5aeff8(0xfc)]),Object['defineProperty'](_0x192ce3,Symbol['toStringTag'],{'value':'Module'});}));
|
|
30
|
-
|
|
31
28
|
// index
|
|
32
|
-
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("@univerjs/docs-thread-comment-ui"),require("@univerjs/thread-comment-ui")
|
|
29
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("@univerjs/docs-thread-comment-ui"),require("@univerjs/thread-comment-ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/docs-thread-comment-ui","@univerjs/thread-comment-ui"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.UniverPresetDocsThreadComment={},e.UniverDocsThreadCommentUi,e.UniverThreadCommentUi))})(this,function(e,n,i){"use strict";function t(r={}){return{plugins:[i.UniverThreadCommentUIPlugin,n.UniverDocsThreadCommentUIPlugin]}}e.UniverDocsThreadCommentPreset=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @univerjs/thread-comment-ui/locale/fr-FR
|
|
2
|
+
(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.UniverThreadCommentUiFrFR=t())})(this,function(){"use strict";return{threadCommentUI:{panel:{title:"Gestion des commentaires",empty:"Pas encore de commentaires",filterEmpty:"Aucun résultat correspondant",reset:"Réinitialiser le filtre",addComment:"Ajouter un commentaire"},editor:{placeholder:"Répondre ou ajouter d'autres avec @",reply:"Commenter",cancel:"Annuler",save:"Enregistrer"},item:{edit:"Modifier",delete:"Supprimer ce commentaire"},filter:{sheet:{all:"Toutes les feuilles",current:"Feuille actuelle"},status:{all:"Tous les commentaires",resolved:"Résolu",unsolved:"Non résolu",concernMe:"Me concerne"}}}}});
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// locale/fr-FR
|
|
6
|
+
(function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("@univerjs/core"),require("@univerjs/thread-comment-ui/locale/fr-FR")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/thread-comment-ui/locale/fr-FR"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsThreadCommentFrFR=r(e.UniverCore,e.UniverThreadCommentUiFrFR))})(this,function(e,r){"use strict";return e.Tools.deepMerge({},r)});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/preset-docs-thread-comment",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1-nightly.202412271606",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"keywords": [
|
|
21
21
|
"univer"
|
|
22
22
|
],
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"*.css"
|
|
25
|
+
],
|
|
23
26
|
"exports": {
|
|
24
27
|
".": {
|
|
25
28
|
"import": "./lib/es/index.js",
|
|
@@ -54,17 +57,16 @@
|
|
|
54
57
|
"rxjs": ">=7.0.0"
|
|
55
58
|
},
|
|
56
59
|
"dependencies": {
|
|
57
|
-
"@univerjs-
|
|
58
|
-
"@univerjs/
|
|
59
|
-
"@univerjs/thread-comment-ui": "0.5.0"
|
|
60
|
+
"@univerjs/docs-thread-comment-ui": "0.5.1-nightly.202412271606",
|
|
61
|
+
"@univerjs/thread-comment-ui": "0.5.1-nightly.202412271606"
|
|
60
62
|
},
|
|
61
63
|
"devDependencies": {
|
|
62
|
-
"@univerjs/core": "0.5.
|
|
63
|
-
"typescript": "^5.
|
|
64
|
-
"@univerjs-infra/shared": "0.5.
|
|
64
|
+
"@univerjs/core": "0.5.1-nightly.202412271606",
|
|
65
|
+
"typescript": "^5.7.2",
|
|
66
|
+
"@univerjs-infra/shared": "0.5.1-nightly.202412271606"
|
|
65
67
|
},
|
|
66
68
|
"scripts": {
|
|
67
|
-
"prebuild": "tsx prepare.ts",
|
|
69
|
+
"prebuild:preset": "tsx prepare.ts",
|
|
68
70
|
"build:preset": "tsx build.ts"
|
|
69
71
|
},
|
|
70
72
|
"module": "./lib/es/index.js"
|