@univerjs/sheets-thread-comment-ui 1.0.0-insiders.20260809-70eefdd → 1.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +16 -8
  3. package/lib/cjs/index.js +675 -156
  4. package/lib/cjs/locale/ar-SA.js +1 -0
  5. package/lib/cjs/locale/ca-ES.js +1 -0
  6. package/lib/cjs/locale/de-DE.js +1 -0
  7. package/lib/cjs/locale/en-US.js +1 -0
  8. package/lib/cjs/locale/es-ES.js +1 -0
  9. package/lib/cjs/locale/fa-IR.js +1 -0
  10. package/lib/cjs/locale/fr-FR.js +1 -0
  11. package/lib/cjs/locale/id-ID.js +1 -0
  12. package/lib/cjs/locale/it-IT.js +1 -0
  13. package/lib/cjs/locale/ja-JP.js +1 -0
  14. package/lib/cjs/locale/ko-KR.js +1 -0
  15. package/lib/cjs/locale/pl-PL.js +1 -0
  16. package/lib/cjs/locale/pt-BR.js +1 -0
  17. package/lib/cjs/locale/ru-RU.js +1 -0
  18. package/lib/cjs/locale/sk-SK.js +1 -0
  19. package/lib/cjs/locale/vi-VN.js +1 -0
  20. package/lib/cjs/locale/zh-CN.js +1 -0
  21. package/lib/cjs/locale/zh-HK.js +1 -0
  22. package/lib/cjs/locale/zh-TW.js +1 -0
  23. package/lib/es/index.js +676 -163
  24. package/lib/es/locale/ar-SA.js +1 -0
  25. package/lib/es/locale/ca-ES.js +1 -0
  26. package/lib/es/locale/de-DE.js +1 -0
  27. package/lib/es/locale/en-US.js +1 -0
  28. package/lib/es/locale/es-ES.js +1 -0
  29. package/lib/es/locale/fa-IR.js +1 -0
  30. package/lib/es/locale/fr-FR.js +1 -0
  31. package/lib/es/locale/id-ID.js +1 -0
  32. package/lib/es/locale/it-IT.js +1 -0
  33. package/lib/es/locale/ja-JP.js +1 -0
  34. package/lib/es/locale/ko-KR.js +1 -0
  35. package/lib/es/locale/pl-PL.js +1 -0
  36. package/lib/es/locale/pt-BR.js +1 -0
  37. package/lib/es/locale/ru-RU.js +1 -0
  38. package/lib/es/locale/sk-SK.js +1 -0
  39. package/lib/es/locale/vi-VN.js +1 -0
  40. package/lib/es/locale/zh-CN.js +1 -0
  41. package/lib/es/locale/zh-HK.js +1 -0
  42. package/lib/es/locale/zh-TW.js +1 -0
  43. package/lib/index.js +676 -163
  44. package/lib/locale/ar-SA.js +1 -0
  45. package/lib/locale/ca-ES.js +1 -0
  46. package/lib/locale/de-DE.js +1 -0
  47. package/lib/locale/en-US.js +1 -0
  48. package/lib/locale/es-ES.js +1 -0
  49. package/lib/locale/fa-IR.js +1 -0
  50. package/lib/locale/fr-FR.js +1 -0
  51. package/lib/locale/id-ID.js +1 -0
  52. package/lib/locale/it-IT.js +1 -0
  53. package/lib/locale/ja-JP.js +1 -0
  54. package/lib/locale/ko-KR.js +1 -0
  55. package/lib/locale/pl-PL.js +1 -0
  56. package/lib/locale/pt-BR.js +1 -0
  57. package/lib/locale/ru-RU.js +1 -0
  58. package/lib/locale/sk-SK.js +1 -0
  59. package/lib/locale/vi-VN.js +1 -0
  60. package/lib/locale/zh-CN.js +1 -0
  61. package/lib/locale/zh-HK.js +1 -0
  62. package/lib/locale/zh-TW.js +1 -0
  63. package/lib/types/commands/operations/comment.operation.d.ts +5 -0
  64. package/lib/types/commands/operations/mobile/show-add-sheet-comment.operation.d.ts +17 -0
  65. package/lib/types/controllers/mobile/components.controller.d.ts +22 -0
  66. package/lib/types/controllers/mobile/sheets-thread-comment.controller.d.ts +20 -0
  67. package/lib/types/controllers/render-controllers/drawing.render-controller.d.ts +35 -0
  68. package/lib/types/controllers/sheets-thread-comment-permission.controller.d.ts +1 -0
  69. package/lib/types/controllers/sheets-thread-comment-popup.controller.d.ts +2 -0
  70. package/lib/types/index.d.ts +1 -0
  71. package/lib/types/locale/en-US.d.ts +1 -0
  72. package/lib/types/menu/menu.d.ts +11 -0
  73. package/lib/types/menu/mobile-menu.d.ts +35 -0
  74. package/lib/types/menu/mobile-schema.d.ts +17 -0
  75. package/lib/types/mobile-plugin.d.ts +31 -0
  76. package/lib/types/plugin.d.ts +3 -1
  77. package/lib/types/services/mobile/mobile-sheet-comment-draft.service.d.ts +31 -0
  78. package/lib/types/types/const.d.ts +1 -0
  79. package/lib/types/views/SheetsThreadCommentPanel.d.ts +5 -1
  80. package/lib/types/views/mobile/MobileSheetsThreadCommentPanel.d.ts +16 -0
  81. package/lib/umd/index.js +3 -1
  82. package/lib/umd/locale/ar-SA.js +1 -1
  83. package/lib/umd/locale/ca-ES.js +1 -1
  84. package/lib/umd/locale/de-DE.js +1 -1
  85. package/lib/umd/locale/en-US.js +1 -1
  86. package/lib/umd/locale/es-ES.js +1 -1
  87. package/lib/umd/locale/fa-IR.js +1 -1
  88. package/lib/umd/locale/fr-FR.js +1 -1
  89. package/lib/umd/locale/id-ID.js +1 -1
  90. package/lib/umd/locale/it-IT.js +1 -1
  91. package/lib/umd/locale/ja-JP.js +1 -1
  92. package/lib/umd/locale/ko-KR.js +1 -1
  93. package/lib/umd/locale/pl-PL.js +1 -1
  94. package/lib/umd/locale/pt-BR.js +1 -1
  95. package/lib/umd/locale/ru-RU.js +1 -1
  96. package/lib/umd/locale/sk-SK.js +1 -1
  97. package/lib/umd/locale/vi-VN.js +1 -1
  98. package/lib/umd/locale/zh-CN.js +1 -1
  99. package/lib/umd/locale/zh-HK.js +1 -1
  100. package/lib/umd/locale/zh-TW.js +1 -1
  101. package/package.json +15 -14
package/lib/umd/index.js CHANGED
@@ -1 +1,3 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-thread-comment"),require("@univerjs/thread-comment-ui"),require("@univerjs/ui"),require("@univerjs/sheets-ui"),require("rxjs"),require("@univerjs/engine-render"),require("@univerjs/thread-comment"),require("react"),require("react/jsx-runtime"),require("@univerjs/engine-formula")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/sheets`,`@univerjs/sheets-thread-comment`,`@univerjs/thread-comment-ui`,`@univerjs/ui`,`@univerjs/sheets-ui`,`rxjs`,`@univerjs/engine-render`,`@univerjs/thread-comment`,`react`,`react/jsx-runtime`,`@univerjs/engine-formula`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsThreadCommentUi={},e.UniverCore,e.UniverSheets,e.UniverSheetsThreadComment,e.UniverThreadCommentUi,e.UniverUi,e.UniverSheetsUi,e.rxjs,e.UniverEngineRender,e.UniverThreadComment,e.React,e.React,e.UniverEngineFormula))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let p=`univer.sheet.thread-comment-modal`,m=`univer.sheet.thread-comment-panel`,h=`SHEET_THREAD_COMMENT_UI_PLUGIN`;function g(e){"@babel/helpers - typeof";return g=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},g(e)}function _(e,t){if(g(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(g(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function v(e){var t=_(e,`string`);return g(t)==`symbol`?t:t+``}function y(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){return function(n,r){t(n,r,e)}}function x(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let S=class extends t.Disposable{get activePopup(){return this._activePopup}constructor(e,t){super(),this._canvasPopupManagerService=e,this._cellPopupManagerService=t,y(this,`_lastPopup`,null),y(this,`_activePopup`,void 0),y(this,`_activePopup$`,new s.BehaviorSubject(null)),y(this,`activePopup$`,this._activePopup$.asObservable()),this.disposeWithMe(()=>{this._activePopup$.complete()})}dispose(){super.dispose(),this.hidePopup()}showPopup(e,n){var r;let{row:i,col:a,unitId:o,subUnitId:s}=e;if(this._activePopup&&i===this._activePopup.row&&a===this._activePopup.col&&o===this._activePopup.unitId&&s===((r=this.activePopup)==null?void 0:r.subUnitId)){this._activePopup=e,this._activePopup$.next(e);return}this._lastPopup&&this._lastPopup.dispose(),this._activePopup=e,this._activePopup$.next(e);let c=this._cellPopupManagerService.showPopup({row:i,col:a,unitId:o,subUnitId:s},{componentKey:p,onClickOutside:()=>{this.hidePopup()},direction:`horizontal`,excludeOutside:[...Array.from(document.querySelectorAll(`.univer-thread-comment`)),document.getElementById(`thread-comment-add`)].filter(Boolean),priority:2});if(!c)throw Error(`[SheetsThreadCommentPopupService]: cannot show popup!`);let l=new t.DisposableCollection;l.add(c),l.add({dispose:()=>{n==null||n()}}),this._lastPopup=l}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}};S=x([b(0,(0,t.Inject)(o.SheetCanvasPopManagerService)),b(1,(0,t.Inject)(o.CellPopupManagerService))],S);let C={type:t.CommandType.OPERATION,id:`sheet.operation.show-comment-modal`,handler(e){var a;let o=e.get(n.SheetsSelectionsService),s=e.get(t.IUniverInstanceService),c=e.get(S),l=e.get(i.ThreadCommentPanelService),u=(a=o.getCurrentLastSelection())==null?void 0:a.primary,d=e.get(r.SheetsThreadCommentModel);if(!u)return!1;let f=(0,n.getSheetCommandTarget)(s);if(!f)return!1;let{workbook:p,worksheet:m,unitId:h,subUnitId:g}=f,_={workbook:p,worksheet:m,unitId:h,subUnitId:g,row:u.startRow,col:u.startColumn};c.showPopup(_);let v=d.getByLocation(h,g,u.startRow,u.startColumn);return v&&l.setActiveComment({unitId:h,subUnitId:g,commentId:v,trigger:`context-menu`}),!0}},w={id:`sheet.operation.toggle-comment-panel`,type:t.CommandType.OPERATION,handler(e){let t=e.get(a.ISidebarService),n=e.get(i.ThreadCommentPanelService);return n.panelVisible?(t.close(),n.setPanelVisible(!1)):(t.open({header:{title:`sheets-thread-comment-ui.panel.title`},children:{label:m},width:360}),n.setPanelVisible(!0)),!0}},T=e=>({id:C.id,type:a.MenuItemType.BUTTON,icon:`CommentIcon`,title:`sheets-thread-comment-ui.menu.addComment`,hidden$:(0,a.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]})}),E=e=>({id:w.id,type:a.MenuItemType.BUTTON,icon:`CommentIcon`,tooltip:`sheets-thread-comment-ui.menu.commentManagement`,disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]}),hidden$:(0,a.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET)}),D={id:C.id,binding:a.KeyCode.M|a.MetaKeys.CTRL_COMMAND|a.MetaKeys.ALT,preconditions:o.whenSheetEditorFocused},O={[a.RibbonInsertGroup.MEDIA]:{[w.id]:{order:2,gridLayout:{row:1,column:3,rowSpan:2,showLabel:!0},menuItemFactory:E}},[a.ContextMenuPosition.MAIN_AREA]:{[a.ContextMenuGroup.OTHERS]:{[C.id]:{order:0,menuItemFactory:T}}}};var k=`@univerjs/sheets-thread-comment-ui`,A=`1.0.0-insiders.20260809-70eefdd`;let j={};function M({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,u.useRef)(`_${I()}`);return N(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function N(e,t,n,r,i){return(0,u.createElement)(e.tag,{key:t,...P(e,n,i),...r},(F(e,n).children||[]).map((r,a)=>N(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function P(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),n!=null&&n.colorChannel1&&r.stroke===`colorChannel1`&&(r.stroke=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function F(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function I(){return Math.random().toString(36).substring(2,8)}M.displayName=`UniverIcon`;let L={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`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.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.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.78345Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M11.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`}},{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`}}]},R=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(M,Object.assign({},e,{id:`comment-icon`,ref:t,icon:L}))});R.displayName=`CommentIcon`;let z=()=>{let e=(0,a.useDependency)(t.IUniverInstanceService),n=(0,a.useDependency)(S),o=(0,a.useObservable)(n.activePopup$),c=(0,a.useDependency)(r.SheetsThreadCommentModel),l=(0,a.useObservable)(o?()=>c.commentUpdate$.pipe((0,s.map)(()=>c.getByLocation(o.unitId,o.subUnitId,o.row,o.col)),(0,s.startWith)(c.getByLocation(o.unitId,o.subUnitId,o.row,o.col))):null,void 0,!1,[o,c]);if(!o)return null;let{row:u,col:f,unitId:p,subUnitId:m,trigger:h}=o,g=`${t.Tools.chatAtABC(f)}${u+1}`;return(0,d.jsx)(i.ThreadCommentTree,{onClick:()=>{n.persistPopup()},location:i.ThreadCommentTreeLocation.CELL,id:l,unitId:p,subUnitId:m,type:t.UniverInstanceType.UNIVER_SHEET,refStr:g,onClose:()=>{n.hidePopup()},getSubUnitName:n=>{var r;return((r=e.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET))==null||(r=r.getSheetBySheetId(n))==null?void 0:r.getName())??``},autoFocus:h===`context-menu`})},B=()=>{var e;let n=(0,a.useDependency)(o.IMarkSelectionService),r=(0,a.useDependency)(t.IUniverInstanceService),c=(0,a.useDependency)(S),l=r.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET),p=l.getUnitId(),m=(0,a.useDependency)(t.ICommandService),h=(0,u.useMemo)(()=>l.activeSheet$.pipe((0,s.map)(e=>e==null?void 0:e.getSheetId())),[l.activeSheet$]),g=(0,a.useObservable)(h,(e=l.getActiveSheet())==null?void 0:e.getSheetId()),_=(0,u.useRef)(null),v=(0,a.useDependency)(i.ThreadCommentPanelService),y=(0,a.useObservable)(v.activeCommentId$),b=(0,a.useObservable)(v.panelVisible$,v.panelVisible),x=(0,u.useCallback)(e=>{let t=l.getSheets(),n={};t.forEach((e,t)=>{n[e.getSheetId()]=t});let r=e=>e.map(e=>{let t=(0,f.singleReferenceToGrid)(e.ref),r=[n[e.subUnitId]??0,t.row,t.column];return{...e,p:r}}).sort((e,t)=>e.p[0]===t.p[0]?e.p[1]===t.p[1]?e.p[2]-t.p[2]:e.p[1]-t.p[1]:e.p[0]-t.p[0]);return[...r(e.filter(e=>!e.resolved)),...r(e.filter(e=>e.resolved))]},[l]),w=(0,u.useCallback)(e=>{if(e.unitId===p&&e.subUnitId===g&&!e.resolved){let{row:t,column:r}=(0,f.singleReferenceToGrid)(e.ref),i=l.getSheetBySheetId(e.subUnitId),a=(i==null?void 0:i.getMergedCell(t,r))??{startColumn:r,endColumn:r,startRow:t,endRow:t};if(!Number.isNaN(t)&&!Number.isNaN(r))return n.addShape({range:a,style:{fill:`rgb(255, 189, 55, 0.35)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null})}return null},[n,g,p]),T=e=>{var t;return((t=l.getSheetBySheetId(e))==null?void 0:t.getName())??``},E=()=>{m.executeCommand(C.id)},D=e=>{_.current&&=(n.removeShape(_.current),null),!(y&&y.unitId===e.unitId&&y.subUnitId===e.subUnitId&&y.commentId===e.id)&&(_.current=w(e))},O=()=>{_.current&&=(n.removeShape(_.current),null)};return(0,u.useEffect)(()=>{!b&&_.current&&(n.removeShape(_.current),_.current=null)},[n,b]),(0,d.jsx)(i.ThreadCommentPanel,{unitId:p,subUnitId$:h,type:t.UniverInstanceType.UNIVER_SHEET,onAdd:E,getSubUnitName:T,onResolve:(e,t)=>{t&&c.hidePopup()},sortComments:x,onItemEnter:D,onItemLeave:O,onDeleteComment:()=>(O(),!0)})},V=class extends t.Disposable{constructor(e,t){super(),this._componentManager=e,this._iconManager=t,this._registerComponents(),this._registerIcons()}_registerComponents(){[[p,z],[m,B]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}_registerIcons(){this.disposeWithMe(this._iconManager.register({CommentIcon:R}))}};V=x([b(0,(0,t.Inject)(a.ComponentManager)),b(1,(0,t.Inject)(a.IconManager))],V);let H=class extends t.Disposable{constructor(e,t,n,r){super(),this._sheetInterceptorService=e,this._sheetsThreadCommentModel=t,this._univerInstanceService=n,this._renderManagerService=r,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(n.INTERCEPTOR_POINT.CELL_CONTENT,{effect:t.InterceptorEffectEnum.Style,handler:(e,t,n)=>{let{row:r,col:i,unitId:a,subUnitId:o}=t;return this._sheetsThreadCommentModel.showCommentMarker(a,o,r,i)?((!e||e===t.rawData)&&(e={...t.rawData}),e.markers={...e==null?void 0:e.markers,tr:{color:`#FFBD37`,size:6}},n(e)):n(e)},priority:100}))}_initSkeletonChange(){let e=()=>{var e;let n=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET);if(!n)return;let r=n.getUnitId(),i=this._renderManagerService.getRenderUnitById(r);i==null||(e=i.mainComponent)==null||e.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe((0,s.debounceTime)(16)).subscribe(()=>{e()}))}};H=x([b(0,(0,t.Inject)(n.SheetInterceptorService)),b(1,(0,t.Inject)(r.SheetsThreadCommentModel)),b(2,t.IUniverInstanceService),b(3,c.IRenderManagerService)],H);let U=(e,t,n)=>{let r=(0,f.singleReferenceToGrid)(e),i=n.row-t.row,a=n.column-t.column;return(0,f.serializeRange)({startColumn:r.column+a,startRow:r.row+i,endColumn:r.column+a,endRow:r.row+i})},W=class extends t.Disposable{constructor(e,t,n){super(),this._sheetClipboardService=e,this._sheetsThreadCommentModel=t,this._threadCommentDataSourceService=n,y(this,`_copyInfo`,void 0),this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:h,onBeforeCopy:(e,t,n)=>{this._copyInfo={unitId:e,subUnitId:t,range:n}},onPasteCells:(e,n,r,i)=>{let{unitId:a,subUnitId:s,range:c}=n,u={row:c.rows[0],column:c.cols[0]};if(i.copyType===o.COPY_TYPE.CUT&&this._copyInfo){let{range:e,unitId:n,subUnitId:r}=this._copyInfo,i={row:e.startRow,column:e.startColumn};if(a!==n||s!==r){let o=[];t.Range.foreach(e,(e,t)=>{let i=this._sheetsThreadCommentModel.getAllByLocation(n,r,e,t);this._threadCommentDataSourceService.syncUpdateMutationToColla?i.forEach(e=>{o.push(e)}):i.forEach(({children:e,...t})=>{t.parentId||o.push(t)})});let c=[],d=[],f=[],p=[],m=e=>{c.unshift({id:l.DeleteCommentMutation.id,params:{unitId:n,subUnitId:r,commentId:e.id}}),f.push({id:l.AddCommentMutation.id,params:{unitId:a,subUnitId:s,comment:{...e,ref:U(e.ref,i,u),unitId:a,subUnitId:s},sync:!0}}),d.push({id:l.AddCommentMutation.id,params:{unitId:n,subUnitId:r,comment:e,sync:!0}}),p.unshift({id:l.DeleteCommentMutation.id,params:{unitId:a,subUnitId:s,commentId:e.id}})};return o.forEach(e=>{m(e)}),{redos:[...c,...f],undos:[...p,...d]}}}return{redos:[],undos:[]}}}))}};W=x([b(0,(0,t.Inject)(o.ISheetClipboardService)),b(1,(0,t.Inject)(r.SheetsThreadCommentModel)),b(2,l.IThreadCommentDataSourceService)],W);let G=class extends t.Disposable{constructor(e,t,n,r){super(),this._hoverManagerService=e,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._sheetPermissionCheckController=r,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe((0,s.debounceTime)(100)).subscribe(e=>{let t=this._sheetsThreadCommentPopupService.activePopup;if(e&&(t&&t.temp||!t)){let{location:r}=e,{unitId:i,subUnitId:a,row:o,col:s}=r,c=this._sheetsThreadCommentModel.getByLocation(i,a,o,s);if(c){if(!this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:o,startColumn:s,endRow:o,endColumn:s}],i,a))return;let e=this._sheetsThreadCommentModel.getComment(i,a,c);e&&!e.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:i,subUnitId:a,row:o,col:s,commentId:c,temp:!0})}else t&&this._sheetsThreadCommentPopupService.hidePopup()}}))}};G=x([b(0,(0,t.Inject)(o.HoverManagerService)),b(1,(0,t.Inject)(S)),b(2,(0,t.Inject)(r.SheetsThreadCommentModel)),b(3,(0,t.Inject)(n.SheetPermissionCheckController))],G);let K=class extends t.Disposable{constructor(e,t,n,r){super(),this._localeService=e,this._commandService=t,this._sheetPermissionCheckController=n,this._sheetsThreadCommentModel=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{let{id:t}=e;if(t===C.id||t===w.id)this._sheetPermissionCheckController.permissionCheckWithoutRange({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission]})||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`sheets-thread-comment-ui.permission.commentErr`));else if(t===l.AddCommentCommand.id){let{unitId:t,subUnitId:r,comment:i}=e.params,{row:a,column:o}=(0,f.singleReferenceToGrid)(i.ref);this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:a,startColumn:o,endRow:a,endColumn:o}],t,r)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`sheets-thread-comment-ui.permission.commentErr`))}else if(t===l.UpdateCommentCommand.id){let{unitId:t,subUnitId:r,payload:i}=e.params,{commentId:a}=i,o=this._sheetsThreadCommentModel.getComment(t,r,a);if(o){let{row:e,column:i}=(0,f.singleReferenceToGrid)(o.ref);this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:e,startColumn:i,endRow:e,endColumn:i}],t,r)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`sheets-thread-comment-ui.permission.commentErr`))}}else if(t===l.ResolveCommentCommand.id||t===l.DeleteCommentCommand.id||t===l.DeleteCommentTreeCommand.id){let{unitId:t,subUnitId:r,commentId:i}=e.params,a=this._sheetsThreadCommentModel.getComment(t,r,i);if(a){let{row:e,column:i}=(0,f.singleReferenceToGrid)(a.ref);this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:e,startColumn:i,endRow:e,endColumn:i}],t,r)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`sheets-thread-comment-ui.permission.commentErr`))}}}))}};K=x([b(0,(0,t.Inject)(t.LocaleService)),b(1,t.ICommandService),b(2,(0,t.Inject)(n.SheetPermissionCheckController)),b(3,(0,t.Inject)(r.SheetsThreadCommentModel))],K);let q=class extends t.Disposable{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._commandService=e,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._threadCommentPanelService=r,this._univerInstanceService=i,this._sheetPermissionCheckController=a,this._markSelectionService=o,this._sheetSelectionService=s,this._editorBridgeService=c,this._renderManagerService=l,y(this,`_isSwitchToCommenting`,!1),y(this,`_selectionShapeInfo`,null),this._initCommandListener(),this._initPanelListener(),this._initMarkSelection(),this._initSelectionUpdateListener(),this._initEditorBridge()}_handleSelectionChange(e,n,r){var a,s;let c=(a=e[0])==null?void 0:a.range,l=this._renderManagerService.getRenderUnitById(n),u=l==null||(s=l.with(o.SheetSkeletonManagerService).getSkeletonParam(r))==null?void 0:s.skeleton;if(!u||!c)return;let d=u.getCellWithCoordByIndex(c.startRow,c.startColumn);if(((c.rangeType??t.RANGE_TYPE.NORMAL)!==t.RANGE_TYPE.NORMAL||c.endColumn-c.startColumn>0||c.endRow-c.startRow>0)&&!((d.isMerged||d.isMergedMainCell)&&t.Rectangle.equals(d.mergeInfo,c))){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(i.SetActiveCommentOperation.id);return}let f=d.actualRow,p=d.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(n,r,f,p)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(i.SetActiveCommentOperation.id);return}let m=this._sheetsThreadCommentModel.getByLocation(n,r,f,p);m&&this._commandService.executeCommand(i.SetActiveCommentOperation.id,{unitId:n,subUnitId:r,commentId:m})}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(e=>{if(this._isSwitchToCommenting)return;let t=this._sheetSelectionService.currentSelectionParam;t&&this._handleSelectionChange(e,t.unitId,t.sheetId)}))}_initEditorBridge(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(e=>{e.visible&&this._sheetsThreadCommentPopupService.hidePopup()}))}_initCommandListener(){this._commandService.onCommandExecuted(e=>{if(e.id===l.DeleteCommentMutation.id){let t=e.params,n=this._sheetsThreadCommentPopupService.activePopup;if(!n)return;let{unitId:r,subUnitId:i,commentId:a}=n;t.unitId===r&&t.subUnitId===i&&t.commentId===a&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async e=>{if(e){var r;let{unitId:i,subUnitId:a,commentId:s,trigger:c}=e,l=this._sheetsThreadCommentModel.getComment(i,a,s);if(!l||l.resolved)return;let u=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET);if(!u||u.getUnitId()!==i)return;this._isSwitchToCommenting=!0,((r=u.getActiveSheet())==null?void 0:r.getSheetId())!==a&&await this._commandService.executeCommand(n.SetWorksheetActiveOperation.id,{unitId:i,subUnitId:a}),this._isSwitchToCommenting=!1;let d=(0,f.singleReferenceToGrid)(l.ref),{row:p,column:m}=d;if(!this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:p,startColumn:m,endRow:p,endColumn:m}],i,a)||(await this._commandService.executeCommand(o.ScrollToRangeOperation.id,{range:{startRow:Math.max(d.row-1,0),endRow:d.row+1,startColumn:Math.max(d.column-1,0),endColumn:d.column+1}}),this._editorBridgeService.isVisible().visible))return;this._sheetsThreadCommentPopupService.showPopup({unitId:i,subUnitId:a,row:d.row,col:d.column,commentId:l.id,trigger:c})}else this._sheetsThreadCommentPopupService.hidePopup()}))}_initMarkSelection(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe((0,s.debounceTime)(100)).subscribe(e=>{var n;if(!e){this._selectionShapeInfo&&=(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),null);return}let{unitId:r,subUnitId:i,commentId:a}=e;this._selectionShapeInfo&&=(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),null);let o=this._sheetsThreadCommentModel.getComment(r,i,a);if(!o)return;let{row:s,column:c}=(0,f.singleReferenceToGrid)(o.ref);if(Number.isNaN(s)||Number.isNaN(c))return null;let l=(n=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET))==null?void 0:n.getSheetBySheetId(i),u=(l==null?void 0:l.getMergedCell(s,c))??{startColumn:c,endColumn:c,startRow:s,endRow:s},d=this._markSelectionService.addShape({range:u,style:{fill:`rgba(255, 189, 55, 0.35)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null},[],-1);d&&(this._selectionShapeInfo={...e,shapeId:d})}))}};q=x([b(0,t.ICommandService),b(1,(0,t.Inject)(S)),b(2,(0,t.Inject)(r.SheetsThreadCommentModel)),b(3,(0,t.Inject)(i.ThreadCommentPanelService)),b(4,t.IUniverInstanceService),b(5,(0,t.Inject)(n.SheetPermissionCheckController)),b(6,o.IMarkSelectionService),b(7,(0,t.Inject)(n.SheetsSelectionsService)),b(8,o.IEditorBridgeService),b(9,c.IRenderManagerService)],q);let J=class extends t.Disposable{constructor(e,t){super(),this._menuManagerService=e,this._shortcutService=t,this._initMenu(),this._initShortcut()}_initShortcut(){this._shortcutService.registerShortcut(D)}_initMenu(){this._menuManagerService.mergeMenu(O)}};J=x([b(0,a.IMenuManagerService),b(1,a.IShortcutService)],J);let Y=class extends t.Plugin{constructor(e=j,n,r,i){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=i;let{menu:a,...o}=(0,t.merge)({},j,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(`sheets-thread-comment.config`,o)}onStarting(){this._injector.add([V]),this._injector.get(V),[[J],[H],[W],[G],[q],[S],[K]].forEach(e=>{this._injector.add(e)}),[C,w].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(J)}onReady(){this._injector.get(H)}onRendered(){this._injector.get(W),this._injector.get(G),this._injector.get(q),this._injector.get(K)}};y(Y,`pluginName`,h),y(Y,`packageName`,k),y(Y,`version`,A),y(Y,`type`,t.UniverInstanceType.UNIVER_SHEET),Y=x([(0,t.DependentOn)(c.UniverRenderEnginePlugin,l.UniverThreadCommentPlugin,n.UniverSheetsPlugin,i.UniverThreadCommentUIPlugin,r.UniverSheetsThreadCommentPlugin,o.UniverSheetsUIPlugin),b(1,(0,t.Inject)(t.Injector)),b(2,(0,t.Inject)(t.ICommandService)),b(3,t.IConfigService)],Y),Object.defineProperty(e,"SheetsThreadCommentPopupService",{enumerable:!0,get:function(){return S}}),e.SheetsThreadCommentUIMenuSchema=O,e.ShowAddSheetCommentModalOperation=C,e.ToggleSheetCommentPanelOperation=w,Object.defineProperty(e,"UniverSheetsThreadCommentUIPlugin",{enumerable:!0,get:function(){return Y}})});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core"),require("@univerjs/drawing"),require("@univerjs/sheets"),require("@univerjs/sheets-thread-comment"),require("@univerjs/thread-comment"),require("@univerjs/thread-comment-ui"),require("@univerjs/ui"),require("@univerjs/sheets-ui"),require("rxjs"),require("@univerjs/engine-render"),require("react"),require("@univerjs/engine-formula"),require("react/jsx-runtime")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/drawing`,`@univerjs/sheets`,`@univerjs/sheets-thread-comment`,`@univerjs/thread-comment`,`@univerjs/thread-comment-ui`,`@univerjs/ui`,`@univerjs/sheets-ui`,`rxjs`,`@univerjs/engine-render`,`react`,`@univerjs/engine-formula`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsThreadCommentUi={},e.UniverCore,e.UniverDrawing,e.UniverSheets,e.UniverSheetsThreadComment,e.UniverThreadComment,e.UniverThreadCommentUi,e.UniverUi,e.UniverSheetsUi,e.rxjs,e.UniverEngineRender,e.React,e.UniverEngineFormula,e.React))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let m=`univer.sheet.thread-comment-modal`,h=`univer.sheet.thread-comment-panel`,g=`sheet.operation.show-comment-modal`,_=`SHEET_THREAD_COMMENT_UI_PLUGIN`;function v(e){"@babel/helpers - typeof";return v=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},v(e)}function y(e,t){if(v(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(v(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ee(e){var t=y(e,`string`);return v(t)==`symbol`?t:t+``}function b(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){return function(n,r){t(n,r,e)}}function S(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let C=class extends t.Disposable{get activePopup(){return this._activePopup}constructor(e,t){super(),this._canvasPopupManagerService=e,this._cellPopupManagerService=t,b(this,`_lastPopup`,null),b(this,`_activePopup`,void 0),b(this,`_activePopup$`,new l.BehaviorSubject(null)),b(this,`activePopup$`,this._activePopup$.asObservable()),this.disposeWithMe(()=>{this._activePopup$.complete()})}dispose(){super.dispose(),this.hidePopup()}showPopup(e,n){var r;let{row:i,col:a,unitId:o,subUnitId:s}=e;if(this._activePopup&&i===this._activePopup.row&&a===this._activePopup.col&&o===this._activePopup.unitId&&s===((r=this.activePopup)==null?void 0:r.subUnitId)){this._activePopup=e,this._activePopup$.next(e);return}this._lastPopup&&this._lastPopup.dispose(),this._activePopup=e,this._activePopup$.next(e);let c=this._cellPopupManagerService.showPopup({row:i,col:a,unitId:o,subUnitId:s},{componentKey:m,onClickOutside:()=>{this.hidePopup()},direction:`horizontal`,excludeOutside:[...Array.from(document.querySelectorAll(`.univer-thread-comment`)),document.getElementById(`thread-comment-add`)].filter(Boolean),priority:2});if(!c)throw Error(`[SheetsThreadCommentPopupService]: cannot show popup!`);let l=new t.DisposableCollection;l.add(c),l.add({dispose:()=>{n==null||n()}}),this._lastPopup=l}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}};C=S([x(0,(0,t.Inject)(c.SheetCanvasPopManagerService)),x(1,(0,t.Inject)(c.CellPopupManagerService))],C);let w={type:t.CommandType.OPERATION,id:g,handler(e){var n;let a=e.get(r.SheetsSelectionsService),s=e.get(t.IUniverInstanceService),c=e.get(C),l=e.get(o.ThreadCommentPanelService),u=(n=a.getCurrentLastSelection())==null?void 0:n.primary,d=e.get(i.SheetsThreadCommentModel);if(!u)return!1;let f=(0,r.getSheetCommandTarget)(s);if(!f)return!1;let{workbook:p,worksheet:m,unitId:h,subUnitId:g}=f,_={workbook:p,worksheet:m,unitId:h,subUnitId:g,row:u.startRow,col:u.startColumn};c.showPopup(_);let v=d.getByLocation(h,g,u.startRow,u.startColumn);return v&&l.setActiveComment({unitId:h,subUnitId:g,commentId:v,trigger:`context-menu`}),!0}},T={id:`sheet.operation.toggle-comment-panel`,type:t.CommandType.OPERATION,handler(e){let t=e.get(s.ISidebarService),n=e.get(o.ThreadCommentPanelService);return n.panelVisible?(t.close(),n.setPanelVisible(!1)):D(t,n),!0}},E={id:`sheet.operation.open-comment-panel`,type:t.CommandType.OPERATION,handler(e){return D(e.get(s.ISidebarService),e.get(o.ThreadCommentPanelService)),!0}};function D(e,t){var n;(!t.panelVisible||((n=e.options.children)==null?void 0:n.label)!==`univer.sheet.thread-comment-panel`)&&e.open({header:{title:`sheets-thread-comment-ui.panel.title`},children:{label:h},width:360,onClose:()=>t.setPanelVisible(!1)}),t.setPanelVisible(!0)}let O={id:`sheet.operation.add-drawing-comment`,type:t.CommandType.OPERATION,handler(e){var r;let i=e.get(n.IDrawingManagerService).getFocusDrawings()[0],c=e.get(t.IUniverInstanceService).getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET);if(!i||!c||i.unitId!==c.getUnitId()||i.subUnitId!==((r=c.getActiveSheet())==null?void 0:r.getSheetId()))return!1;e.get(o.ThreadCommentDraftService).place({unitId:i.unitId,subUnitId:i.subUnitId,anchor:{kind:a.ThreadCommentAnchorKind.SHEET_DRAWING,pageId:i.subUnitId,elementId:i.drawingId}});let l=e.get(o.ThreadCommentPanelService);return e.get(s.ISidebarService).open({header:{title:`sheets-thread-comment-ui.panel.title`},children:{label:h},width:360,onClose:()=>l.setPanelVisible(!1)}),l.setPanelVisible(!0),!0}};function k(e){let n=e.get(t.IUniverInstanceService),i=e.get(t.IPermissionService);return(0,c.deriveStateFromActiveSheet$)(n,!0,({workbook:e,worksheet:t})=>{let n=e.getUnitId(),a=t.getSheetId();return i.composePermission$([new r.WorkbookCommentPermission(n).id,new r.WorksheetViewPermission(n,a).id]).pipe((0,l.map)(e=>e.some(e=>e.value===!1)))})}let A=e=>({id:O.id,type:s.MenuItemType.BUTTON,icon:`InsertCommentDoubleIcon`,title:`sheets-thread-comment-ui.menu.addComment`,tooltip:`sheets-thread-comment-ui.menu.addComment`,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:k(e)}),j=e=>({id:w.id,type:s.MenuItemType.BUTTON,icon:`InsertCommentDoubleIcon`,title:`sheets-thread-comment-ui.menu.addComment`,tooltip:`sheets-thread-comment-ui.menu.addComment`,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:(0,c.getCurrentRangeDisable$)(e,{workbookTypes:[r.WorkbookCommentPermission],worksheetTypes:[r.WorksheetViewPermission],rangeTypes:[r.RangeProtectionPermissionViewPoint]})}),M=e=>({id:T.id,type:s.MenuItemType.BUTTON,icon:`CommentIcon`,title:`sheets-thread-comment-ui.menu.openComments`,tooltip:`sheets-thread-comment-ui.menu.openComments`,disabled$:(0,c.getCurrentRangeDisable$)(e,{workbookTypes:[r.WorkbookCommentPermission],worksheetTypes:[r.WorksheetViewPermission],rangeTypes:[r.RangeProtectionPermissionViewPoint]}),hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET)}),N={id:w.id,binding:s.KeyCode.M|s.MetaKeys.CTRL_COMMAND|s.MetaKeys.ALT,preconditions:c.whenSheetEditorFocused},te={[s.RibbonInsertGroup.MEDIA]:{[T.id]:{order:2,gridLayout:{row:1,column:3,showLabel:!0},menuItemFactory:M},[w.id]:{order:2.1,gridLayout:{row:2,column:3,showLabel:!0},menuItemFactory:j}},[s.ContextMenuPosition.MAIN_AREA]:{[s.ContextMenuGroup.OTHERS]:{[w.id]:{order:0,menuItemFactory:j}}},[s.FloatingObjectToolbarPosition.SHEET]:{[O.id]:{order:10,menuItemFactory:A}},[s.ContextMenuPosition.DRAWING]:{[s.ContextMenuGroup.OTHERS]:{[O.id]:{order:0,menuItemFactory:A}}}};var ne=`@univerjs/sheets-thread-comment-ui`,re=`1.0.0-rc.0`,P=class extends t.Disposable{constructor(){super(),b(this,`_draft$`,new l.BehaviorSubject(null)),b(this,`draft$`,this._draft$.asObservable()),this.disposeWithMe(()=>this._draft$.complete())}get draft(){return this._draft$.getValue()}place(e){this._draft$.next(e)}cancel(){this._draft$.next(null)}};let F={type:t.CommandType.OPERATION,id:g,handler(e){var n;let a=(n=e.get(r.SheetsSelectionsService).getCurrentLastSelection())==null?void 0:n.primary;if(!a)return!1;let c=(0,r.getSheetCommandTarget)(e.get(t.IUniverInstanceService));if(!c)return!1;let{unitId:l,subUnitId:u}=c,d=a.startRow,f=a.startColumn,p=e.get(o.ThreadCommentPanelService),m=e.get(P),h=e.get(i.SheetsThreadCommentModel).getByLocation(l,u,d,f);return e.get(o.ThreadCommentDraftService).cancel(),h?(m.cancel(),p.setActiveComment({unitId:l,subUnitId:u,commentId:h})):(p.setActiveComment(void 0),m.place({unitId:l,subUnitId:u,row:d,column:f})),D(e.get(s.ISidebarService),p),!0}},I=`sheets-thread-comment.config`,L={};function R({ref:e,...t}){let{preserveStrokeWidth:n,icon:r,id:i,className:a,extend:o,...s}=t,c=`univerjs-icon univerjs-icon-${i} ${a||``}`.trim(),l=`_${(0,d.useId)()}`,u=(0,d.useRef)(null);return(0,d.useImperativeHandle)(e,()=>u.current),(0,d.useLayoutEffect)(()=>{if(!(!n||!u.current||u.current.localName!==r.tag))return se(u.current)},[n,r]),ie(r,`${i}`,{defIds:r.defIds,idSuffix:l},{ref:u,className:c,...s},o)}function ie(e,t,n,r,i){return(0,d.createElement)(e.tag,{key:t,...ae(e,n,i),...r},(oe(e,n).children||[]).map((r,a)=>ie(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function ae(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),n!=null&&n.colorChannel1&&r.stroke===`colorChannel1`&&(r.stroke=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function oe(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function se(e){let t=e.viewBox.baseVal,n=Math.max(t.width,t.height);if(!Number.isFinite(n)||n<=0||t.width<=0||t.height<=0)return()=>void 0;let r=16/n,i=Array.from(e.querySelectorAll(`circle, ellipse, line, path, polygon, polyline, rect, text, textPath, tspan, use`)).flatMap(e=>{let t=getComputedStyle(e),n=Number.parseFloat(t.strokeWidth);return t.stroke===`none`||Number.parseFloat(t.strokeOpacity)===0||t.vectorEffect===`non-scaling-stroke`||!Number.isFinite(n)||n<=0?[]:[{element:e,hadStyleAttribute:e.hasAttribute(`style`),originalStrokeWidth:n,strokeWidth:ce(e.style,`stroke-width`)}]}).map(e=>({appliedStrokeWidth:null,element:e.element,hadStyleAttribute:e.hadStyleAttribute,isReleased:!1,originalStrokeWidth:e.originalStrokeWidth,strokeWidth:e.strokeWidth}));if(i.length===0)return()=>void 0;let a=(e,n)=>{if(t.width<=0||t.height<=0||e<=0||n<=0)return;let a=Math.min(e/t.width,n/t.height);!Number.isFinite(a)||a<=0||i.forEach(e=>{if(e.isReleased)return;if(e.appliedStrokeWidth!==null&&(e.element.style.getPropertyValue(`stroke-width`)!==e.appliedStrokeWidth||e.element.style.getPropertyPriority(`stroke-width`)!==e.strokeWidth.priority)){e.appliedStrokeWidth=null,e.isReleased=!0;return}let t=e.originalStrokeWidth*r/a,n=`${Number(t.toFixed(12))}px`;e.element.style.setProperty(`stroke-width`,n,e.strokeWidth.priority),e.appliedStrokeWidth=n})},o=e.getBoundingClientRect();a(o.width,o.height);let s=typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{if(t.some(t=>t.target===e)){let t=e.getBoundingClientRect();a(t.width,t.height)}});return s==null||s.observe(e),()=>{s==null||s.disconnect(),i.forEach(e=>{e.appliedStrokeWidth!==null&&(le(e.element.style,`stroke-width`,e.appliedStrokeWidth,e.strokeWidth.priority,e.strokeWidth),!e.hadStyleAttribute&&e.element.style.length===0&&e.element.removeAttribute(`style`))})}}function ce(e,t){return{priority:e.getPropertyPriority(t),value:e.getPropertyValue(t)}}function le(e,t,n,r,i){e.getPropertyValue(t)===n&&e.getPropertyPriority(t)===r&&(i.value?e.setProperty(t,i.value,i.priority):e.removeProperty(t))}R.displayName=`UniverIcon`;let ue={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M2.43993 3.31861H15.0381V12.5611H8.65676L5.75498 14.069V12.5611H2.43993V3.31861Z`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M5.83725 7.50706V8.41159M8.73904 7.50706V8.41159M11.6408 7.50706V8.41159`,strokeLinecap:`round`,strokeWidth:1.39}}]},z=(0,d.forwardRef)(function(e,t){return(0,d.createElement)(R,Object.assign({},e,{id:`comment-icon`,ref:t,icon:ue}))});z.displayName=`CommentIcon`;let de={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.63636 1.99658C1.28491 1.99658 1 2.28149 1 2.63295V10.2693C1 10.6208 1.28491 10.9057 1.63636 10.9057H2.96368L4.05003 11.992C4.29854 12.2405 4.70146 12.2405 4.94997 11.992L6.03632 10.9057H6.72727V12.4128C6.72727 12.7643 7.01218 13.0492 7.36364 13.0492H10.6001L11.3682 13.8173C11.6167 14.0658 12.0196 14.0658 12.2682 13.8173L13.0363 13.0492H14.3636C14.7151 13.0492 15 12.7643 15 12.4128V7.32192C15 6.97047 14.7151 6.68556 14.3636 6.68556H12.4545V2.63295C12.4545 2.28149 12.1696 1.99658 11.8182 1.99658H1.63636ZM12.4545 7.95829V10.2693C12.4545 10.6208 12.1696 10.9057 11.8182 10.9057H8V11.7765H10.8636C11.0324 11.7765 11.1942 11.8435 11.3136 11.9628L11.8182 12.4674L12.3228 11.9628C12.4421 11.8435 12.604 11.7765 12.7727 11.7765H13.7273V7.95829H12.4545ZM11.1818 3.26931H2.27273V9.63295H3.22727C3.39604 9.63295 3.5579 9.70001 3.67725 9.81936L4.5 10.6421L5.32275 9.81936C5.4421 9.70001 5.60396 9.63295 5.77273 9.63295H11.1818V3.26931Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.13617 4.54199C4.78472 4.54199 4.49981 4.8269 4.49981 5.17836C4.49981 5.52981 4.78472 5.81472 5.13617 5.81472H8.95435C9.3058 5.81472 9.59072 5.52981 9.59072 5.17836C9.59072 4.8269 9.3058 4.54199 8.95435 4.54199H5.13617ZM4.49981 7.72381C4.49981 7.37236 4.78472 7.08744 5.13617 7.08744H7.04526C7.39671 7.08744 7.68162 7.37236 7.68162 7.72381C7.68162 8.07526 7.39671 8.36018 7.04526 8.36018H5.13617C4.78472 8.36018 4.49981 8.07526 4.49981 7.72381Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},B=(0,d.forwardRef)(function(e,t){return(0,d.createElement)(R,Object.assign({},e,{id:`insert-comment-double-icon`,ref:t,icon:de}))});B.displayName=`InsertCommentDoubleIcon`;let V=({ThreadCommentPanelComponent:e=o.ThreadCommentPanel}={})=>{var n;let r=(0,s.useDependency)(c.IMarkSelectionService),i=(0,s.useDependency)(t.IUniverInstanceService),u=(0,s.useDependency)(C),m=i.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET),h=m.getUnitId(),g=(0,s.useDependency)(t.ICommandService),_=(0,s.useDependency)(o.ThreadCommentDraftService),v=(0,s.useDependency)(t.UserManagerService),y=(0,s.useObservable)(_.draft$,_.draft),ee=(y==null?void 0:y.anchor.kind)===a.ThreadCommentAnchorKind.SHEET_DRAWING&&y.unitId===h?{id:``,threadId:``,unitId:y.unitId,subUnitId:y.subUnitId,ref:(0,a.serializeThreadCommentAnchor)(y.anchor),dT:``,personId:v.getCurrentUser().userID,text:{dataStream:`\r
2
+ `}}:null,b=(0,d.useMemo)(()=>m.activeSheet$.pipe((0,l.map)(e=>e==null?void 0:e.getSheetId())),[m.activeSheet$]),x=(0,s.useObservable)(b,(n=m.getActiveSheet())==null?void 0:n.getSheetId()),S=(0,d.useRef)(null),T=(0,s.useDependency)(o.ThreadCommentPanelService),E=(0,s.useObservable)(T.activeCommentId$),D=(0,s.useObservable)(T.panelVisible$,T.panelVisible),O=(0,d.useCallback)(e=>{let t=m.getSheets(),n={};t.forEach((e,t)=>{n[e.getSheetId()]=t});let r=e=>e.map(e=>{let t=(0,a.deserializeThreadCommentAnchor)(e.ref);if((t==null?void 0:t.kind)===a.ThreadCommentAnchorKind.SHEET_DRAWING)return{...e,p:[n[e.subUnitId]??0,2**53-1,0]};let r=(0,f.singleReferenceToGrid)(e.ref),i=[n[e.subUnitId]??0,r.row,r.column];return{...e,p:i}}).sort((e,t)=>e.p[0]===t.p[0]?e.p[1]===t.p[1]?e.p[2]-t.p[2]:e.p[1]-t.p[1]:e.p[0]-t.p[0]);return[...r(e.filter(e=>!e.resolved)),...r(e.filter(e=>e.resolved))]},[m]),k=(0,d.useCallback)(e=>{if((0,a.deserializeThreadCommentAnchor)(e.ref))return null;if(e.unitId===h&&e.subUnitId===x&&!e.resolved){let{row:t,column:n}=(0,f.singleReferenceToGrid)(e.ref),i=m.getSheetBySheetId(e.subUnitId),a=(i==null?void 0:i.getMergedCell(t,n))??{startColumn:n,endColumn:n,startRow:t,endRow:t};if(!Number.isNaN(t)&&!Number.isNaN(n))return r.addShape({range:a,style:{fill:`rgb(255, 189, 55, 0.35)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null})}return null},[r,x,h]),A=e=>{var t;return((t=m.getSheetBySheetId(e))==null?void 0:t.getName())??``},j=()=>{g.executeCommand(w.id)},M=e=>{S.current&&=(r.removeShape(S.current),null),!(E&&E.unitId===e.unitId&&E.subUnitId===e.subUnitId&&E.commentId===e.id)&&(S.current=k(e))},N=()=>{S.current&&=(r.removeShape(S.current),null)};return(0,d.useEffect)(()=>{!D&&S.current&&(r.removeShape(S.current),S.current=null)},[r,D]),(0,p.jsx)(e,{unitId:h,subUnitId$:b,type:t.UniverInstanceType.UNIVER_SHEET,onAdd:j,getSubUnitName:A,onResolve:(e,t)=>{t&&u.hidePopup()},sortComments:O,onItemEnter:M,onItemLeave:N,onDeleteComment:()=>(N(),!0),tempComment:ee,onTempCommentClose:()=>_.cancel(),formatRef:e=>{let t=(0,a.deserializeThreadCommentAnchor)(e.ref);return(t==null?void 0:t.kind)===a.ThreadCommentAnchorKind.SHEET_DRAWING?`#${t.elementId}`:e.ref}})};function fe(e){let n=(0,s.useDependency)(P),r=(0,s.useDependency)(t.UserManagerService),i=(0,s.useObservable)(n.draft$,n.draft),a=(i==null?void 0:i.unitId)===e.unitId?{id:``,threadId:``,unitId:i.unitId,subUnitId:i.subUnitId,ref:`${t.Tools.chatAtABC(i.column)}${i.row+1}`,dT:``,personId:r.getCurrentUser().userID,text:{dataStream:`\r
3
+ `}}:null,c=()=>{var t;n.cancel(),(t=e.onTempCommentClose)==null||t.call(e)};return(0,p.jsx)(o.MobileThreadCommentPanel,{...e,tempComment:e.tempComment??a,onTempCommentClose:c,autoFocusActiveComment:!0})}function pe(){return(0,p.jsx)(V,{ThreadCommentPanelComponent:fe})}let H=class extends t.Disposable{constructor(e,t){super(),this._componentManager=e,this._iconManager=t,this.disposeWithMe(this._componentManager.register(h,pe)),this.disposeWithMe(this._iconManager.register({CommentIcon:z,InsertCommentDoubleIcon:B}))}};H=S([x(0,(0,t.Inject)(s.ComponentManager)),x(1,(0,t.Inject)(s.IconManager))],H);function me(e){var t;let n=e.get(r.SheetsSelectionsService),a=(t=n.getCurrentLastSelection())==null?void 0:t.primary,o=n.currentSelectionParam;return!a||!o?`sheets-thread-comment-ui.menu.addComment`:e.get(i.SheetsThreadCommentModel).getByLocation(o.unitId,o.sheetId,a.startRow,a.startColumn)?`sheets-thread-comment-ui.menu.openComments`:`sheets-thread-comment-ui.menu.addComment`}let he=e=>({id:F.id,type:s.MenuItemType.BUTTON,icon:`InsertCommentDoubleIcon`,title:`sheets-thread-comment-ui.menu.addComment`,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:(0,c.getCurrentRangeDisable$)(e,{workbookTypes:[r.WorkbookCommentPermission],worksheetTypes:[r.WorksheetViewPermission],rangeTypes:[r.RangeProtectionPermissionViewPoint]})}),ge=e=>({...he(e),title:me(e)}),_e={[s.RibbonInsertGroup.MEDIA]:{[T.id]:{order:2,gridLayout:{row:1,column:3,showLabel:!0},menuItemFactory:M},[F.id]:{order:2.1,gridLayout:{row:2,column:3,showLabel:!0},menuItemFactory:he}},[s.ContextMenuPosition.MAIN_AREA]:{[s.ContextMenuGroup.OTHERS]:{[F.id]:{order:0,menuItemFactory:ge}}},[s.FloatingObjectToolbarPosition.SHEET]:{[O.id]:{order:10,menuItemFactory:A}},[s.ContextMenuPosition.DRAWING]:{[s.ContextMenuGroup.OTHERS]:{[O.id]:{order:0,menuItemFactory:A}}}},U=class extends t.Disposable{constructor(e){super(),e.mergeMenu(_e)}};U=S([x(0,s.IMenuManagerService)],U);let W=class extends t.Disposable{constructor(e,t,n,r){super(),this._sheetInterceptorService=e,this._sheetsThreadCommentModel=t,this._univerInstanceService=n,this._renderManagerService=r,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(r.INTERCEPTOR_POINT.CELL_CONTENT,{effect:t.InterceptorEffectEnum.Style,handler:(e,t,n)=>{let{row:r,col:i,unitId:a,subUnitId:o}=t;return this._sheetsThreadCommentModel.showCommentMarker(a,o,r,i)?((!e||e===t.rawData)&&(e={...t.rawData}),e.markers={...e==null?void 0:e.markers,tr:{color:`#FFBD37`,size:6}},n(e)):n(e)},priority:100}))}_initSkeletonChange(){let e=()=>{var e;let n=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET);if(!n)return;let r=n.getUnitId(),i=this._renderManagerService.getRenderUnitById(r);i==null||(e=i.mainComponent)==null||e.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe((0,l.debounceTime)(16)).subscribe(()=>{e()}))}};W=S([x(0,(0,t.Inject)(r.SheetInterceptorService)),x(1,(0,t.Inject)(i.SheetsThreadCommentModel)),x(2,t.IUniverInstanceService),x(3,u.IRenderManagerService)],W);let ve=(e,t,n)=>{let r=(0,f.singleReferenceToGrid)(e),i=n.row-t.row,a=n.column-t.column;return(0,f.serializeRange)({startColumn:r.column+a,startRow:r.row+i,endColumn:r.column+a,endRow:r.row+i})},G=class extends t.Disposable{constructor(e,t,n){super(),this._sheetClipboardService=e,this._sheetsThreadCommentModel=t,this._threadCommentDataSourceService=n,b(this,`_copyInfo`,void 0),this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:_,onBeforeCopy:(e,t,n)=>{this._copyInfo={unitId:e,subUnitId:t,range:n}},onPasteCells:(e,n,r,i)=>{let{unitId:o,subUnitId:s,range:l}=n,u={row:l.rows[0],column:l.cols[0]};if(i.copyType===c.COPY_TYPE.CUT&&this._copyInfo){let{range:e,unitId:n,subUnitId:r}=this._copyInfo,i={row:e.startRow,column:e.startColumn};if(o!==n||s!==r){let c=[];t.Range.foreach(e,(e,t)=>{let i=this._sheetsThreadCommentModel.getAllByLocation(n,r,e,t);this._threadCommentDataSourceService.syncUpdateMutationToColla?i.forEach(e=>{c.push(e)}):i.forEach(({children:e,...t})=>{t.parentId||c.push(t)})});let l=[],d=[],f=[],p=[],m=e=>{l.unshift({id:a.DeleteCommentMutation.id,params:{unitId:n,subUnitId:r,commentId:e.id}}),f.push({id:a.AddCommentMutation.id,params:{unitId:o,subUnitId:s,comment:{...e,ref:ve(e.ref,i,u),unitId:o,subUnitId:s},sync:!0}}),d.push({id:a.AddCommentMutation.id,params:{unitId:n,subUnitId:r,comment:e,sync:!0}}),p.unshift({id:a.DeleteCommentMutation.id,params:{unitId:o,subUnitId:s,commentId:e.id}})};return c.forEach(e=>{m(e)}),{redos:[...l,...f],undos:[...p,...d]}}}return{redos:[],undos:[]}}}))}};G=S([x(0,(0,t.Inject)(c.ISheetClipboardService)),x(1,(0,t.Inject)(i.SheetsThreadCommentModel)),x(2,a.IThreadCommentDataSourceService)],G);let K=class extends t.Disposable{constructor(e,t,n,r){super(),this._localeService=e,this._commandService=t,this._sheetPermissionCheckController=n,this._sheetsThreadCommentModel=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{let{id:t}=e;if(t===O.id||t===w.id||t===T.id)this._sheetPermissionCheckController.permissionCheckWithoutRange({workbookTypes:[r.WorkbookCommentPermission],worksheetTypes:[r.WorksheetViewPermission]})||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`sheets-thread-comment-ui.permission.commentErr`));else if(t===a.AddCommentCommand.id){let{unitId:t,subUnitId:n,comment:r}=e.params;this._hasCommentPermission(t,n,r.ref)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`sheets-thread-comment-ui.permission.commentErr`))}else if(t===a.UpdateCommentCommand.id){let{unitId:t,subUnitId:n,payload:r}=e.params,{commentId:i}=r,a=this._sheetsThreadCommentModel.getComment(t,n,i);a&&!this._hasCommentPermission(t,n,a.ref)&&this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`sheets-thread-comment-ui.permission.commentErr`))}else if(t===a.ResolveCommentCommand.id||t===a.DeleteCommentCommand.id||t===a.DeleteCommentTreeCommand.id){let{unitId:t,subUnitId:n,commentId:r}=e.params,i=this._sheetsThreadCommentModel.getComment(t,n,r);i&&!this._hasCommentPermission(t,n,i.ref)&&this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`sheets-thread-comment-ui.permission.commentErr`))}}))}_hasCommentPermission(e,t,n){let i={workbookTypes:[r.WorkbookCommentPermission],worksheetTypes:[r.WorksheetViewPermission]},o=(0,a.deserializeThreadCommentAnchor)(n);if((o==null?void 0:o.kind)===a.ThreadCommentAnchorKind.SHEET_DRAWING)return this._sheetPermissionCheckController.permissionCheckWithoutRange(i,e,t);let{row:s,column:c}=(0,f.singleReferenceToGrid)(n);return!Number.isFinite(s)||!Number.isFinite(c)?!1:this._sheetPermissionCheckController.permissionCheckWithRanges({...i,rangeTypes:[r.RangeProtectionPermissionViewPoint]},[{startRow:s,startColumn:c,endRow:s,endColumn:c}],e,t)}};K=S([x(0,(0,t.Inject)(t.LocaleService)),x(1,t.ICommandService),x(2,(0,t.Inject)(r.SheetPermissionCheckController)),x(3,(0,t.Inject)(i.SheetsThreadCommentModel))],K);let q=class extends t.Plugin{constructor(e=L,n,r,i){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=i;let{menu:a,...o}=(0,t.merge)({},L,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(I,o)}onStarting(){[[H],[U],[W],[G],[C],[K],[P]].forEach(e=>this._injector.add(e)),this._injector.get(H),[O,E,F,T].forEach(e=>this._commandService.registerCommand(e)),this._injector.get(U)}onReady(){this._injector.get(W)}onRendered(){this._injector.get(G),this._injector.get(K)}};b(q,`pluginName`,_),b(q,`packageName`,ne),b(q,`version`,re),b(q,`type`,t.UniverInstanceType.UNIVER_SHEET),q=S([(0,t.DependentOn)(u.UniverRenderEnginePlugin,a.UniverThreadCommentPlugin,r.UniverSheetsPlugin,o.UniverThreadCommentMobileUIPlugin,i.UniverSheetsThreadCommentPlugin,s.UniverMobileUIPlugin,c.UniverSheetsMobileUIPlugin),x(1,(0,t.Inject)(t.Injector)),x(2,(0,t.Inject)(t.ICommandService)),x(3,t.IConfigService)],q);let ye=()=>{let e=(0,s.useDependency)(t.IUniverInstanceService),n=(0,s.useDependency)(C),r=(0,s.useObservable)(n.activePopup$),a=(0,s.useDependency)(i.SheetsThreadCommentModel),c=()=>{if(!r)return;let{unitId:e,subUnitId:t,row:n,col:i,commentId:o}=r,s=o?a.getAllByLocation(e,t,n,i).find(e=>e.id===o):void 0;return s&&!s.resolved?s.id:a.getByLocation(e,t,n,i)},u=(0,s.useObservable)(r?()=>a.commentUpdate$.pipe((0,l.map)(()=>c()),(0,l.startWith)(c())):null,void 0,!1,[r,a]);if(!r)return null;let{row:d,col:f,unitId:m,subUnitId:h,trigger:g}=r,_=`${t.Tools.chatAtABC(f)}${d+1}`;return(0,p.jsx)(o.ThreadCommentTree,{onClick:()=>{n.persistPopup()},location:o.ThreadCommentTreeLocation.CELL,id:u,unitId:m,subUnitId:h,type:t.UniverInstanceType.UNIVER_SHEET,refStr:_,onClose:()=>{n.hidePopup()},getSubUnitName:n=>{var r;return((r=e.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET))==null||(r=r.getSheetBySheetId(n))==null?void 0:r.getName())??``},autoFocus:g===`context-menu`})},J=class extends t.Disposable{constructor(e,t){super(),this._componentManager=e,this._iconManager=t,this._registerComponents(),this._registerIcons()}_registerComponents(){[[m,ye],[h,V]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}_registerIcons(){this.disposeWithMe(this._iconManager.register({CommentIcon:z,InsertCommentDoubleIcon:B}))}};J=S([x(0,(0,t.Inject)(s.ComponentManager)),x(1,(0,t.Inject)(s.IconManager))],J);let Y=class extends t.RxDisposable{constructor(e,n,r,i,a,s){super(),this._context=e,this._commandService=n,this._drawingManagerService=r,this._commentModel=i,this._panelService=a,this._themeService=s,b(this,`_overlay`,void 0),this._overlay=new o.ThreadCommentCanvasOverlay(`sheet-thread-comment-drawing-overlay`,{...this._getColors(),zoomRatio:1,markers:[],underlines:[]}),this._context.scene.addObject(this._overlay,10100),this.disposeWithMe((0,t.toDisposable)(this._overlay.onPointerDown$.subscribeEvent((e,t)=>this._onOverlayPointerDown(t)))),this.disposeWithMe((0,t.toDisposable)(this._context.engine.onTransformChange$.subscribeEvent(()=>this._syncOverlay()))),this.disposeWithMe(this._context.unit.activeSheet$.subscribe(()=>this._syncOverlay())),this.disposeWithMe(this._commentModel.commentUpdate$.subscribe(e=>{e.unitId===this._context.unitId&&this._syncOverlay()})),[this._panelService.activeCommentId$,this._panelService.hoveredCommentId$].forEach(e=>this.disposeWithMe(e.subscribe(()=>this._syncOverlay()))),[this._drawingManagerService.add$,this._drawingManagerService.update$,this._drawingManagerService.remove$].forEach(e=>this.disposeWithMe(e.subscribe(e=>{e.some(e=>e.unitId===this._context.unitId)&&this._syncOverlay()}))),this.disposeWithMe(this._themeService.currentTheme$.subscribe(()=>this._syncOverlay())),this._syncOverlay()}_onOverlayPointerDown(e){var t;let n=this._overlay.hitCommentId,r=(t=this._context.unit.getActiveSheet())==null?void 0:t.getSheetId();!n||!r||(e.stopPropagation(),this._panelService.setActiveComment({unitId:this._context.unitId,subUnitId:r,commentId:n,trigger:`sheet-canvas`}),this._commandService.executeCommand(E.id).catch(()=>void 0))}_syncOverlay(){let e=this._context.unit.getActiveSheet(),t=e==null?void 0:e.getSheetId();if(!e||!t){this._overlay.updateState({markers:[],underlines:[],focusedCommentIds:[],focusOutlines:[]});return}let n=new Map;this._commentModel.query({unitIds:[this._context.unitId],subUnitIds:[t],anchorKinds:[a.ThreadCommentAnchorKind.SHEET_DRAWING],resolved:!1}).forEach(({root:r})=>{let i=(0,a.deserializeThreadCommentAnchor)(r.ref);if((i==null?void 0:i.kind)!==a.ThreadCommentAnchorKind.SHEET_DRAWING)return;let o=this._getDrawingOutline(t,i.elementId);o&&n.set(i.elementId,{commentId:r.id,left:o.left,top:o.top+o.height+2/e.getZoomRatio(),width:o.width})});let r=[],i=new Map;[this._panelService.activeCommentId,this._panelService.hoveredCommentId].forEach(e=>{if(!e||e.unitId!==this._context.unitId||e.subUnitId!==t)return;let n=this._commentModel.getComment(e.unitId,e.subUnitId,e.commentId),o=n&&(0,a.deserializeThreadCommentAnchor)(n.ref);if((o==null?void 0:o.kind)!==a.ThreadCommentAnchorKind.SHEET_DRAWING)return;r.push(e.commentId);let s=this._getDrawingOutline(t,o.elementId);s&&i.set(o.elementId,s)}),this._overlay.updateState({...this._getColors(),zoomRatio:e.getZoomRatio(),markers:[],underlines:Array.from(n.values()),focusedCommentIds:r,focusOutlines:Array.from(i.values())})}_getDrawingOutline(e,t){var r,i;let a=(0,n.getDrawingShapeKeyByDrawingSearch)({unitId:this._context.unitId,subUnitId:e,drawingId:t}),o=((r=(i=this._context.scene).getObjectIncludeInGroup)==null?void 0:r.call(i,a))??this._context.scene.getObject(a);if(!o)return null;let s=o.getRealBound();return{left:s.left,top:s.top,width:s.width,height:s.height}}_getColors(){return{accentColor:this._themeService.getColorFromTheme(`yellow.400`),foregroundColor:this._themeService.getColorFromTheme(`gray.900`),outlineColor:this._themeService.getColorFromTheme(`white`)}}};Y=S([x(1,t.ICommandService),x(2,n.IDrawingManagerService),x(3,(0,t.Inject)(a.ThreadCommentModel)),x(4,(0,t.Inject)(o.ThreadCommentPanelService)),x(5,(0,t.Inject)(t.ThemeService))],Y);let X=class extends t.Disposable{constructor(e,t,n,r){super(),this._hoverManagerService=e,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._sheetPermissionCheckController=r,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe((0,l.debounceTime)(100)).subscribe(e=>{let t=this._sheetsThreadCommentPopupService.activePopup;if(e&&(t&&t.temp||!t)){let{location:n}=e,{unitId:i,subUnitId:a,row:o,col:s}=n,c=this._sheetsThreadCommentModel.getByLocation(i,a,o,s);if(c){if(!this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[r.WorkbookCommentPermission],worksheetTypes:[r.WorksheetViewPermission],rangeTypes:[r.RangeProtectionPermissionViewPoint]},[{startRow:o,startColumn:s,endRow:o,endColumn:s}],i,a))return;let e=this._sheetsThreadCommentModel.getComment(i,a,c);e&&!e.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:i,subUnitId:a,row:o,col:s,commentId:c,temp:!0})}else t&&this._sheetsThreadCommentPopupService.hidePopup()}}))}};X=S([x(0,(0,t.Inject)(c.HoverManagerService)),x(1,(0,t.Inject)(C)),x(2,(0,t.Inject)(i.SheetsThreadCommentModel)),x(3,(0,t.Inject)(r.SheetPermissionCheckController))],X);function be(e,t,n,r){for(let i of[t,e])if(i&&i.unitId===n&&i.subUnitId===r)return i}let Z=class extends t.Disposable{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._commandService=e,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._threadCommentPanelService=r,this._univerInstanceService=i,this._sheetPermissionCheckController=a,this._markSelectionService=o,this._sheetSelectionService=s,this._editorBridgeService=c,this._renderManagerService=l,b(this,`_isSwitchToCommenting`,!1),b(this,`_selectionShapeInfo`,null),this._initCommandListener(),this._initPanelListener(),this._initMarkSelection(),this._initSelectionUpdateListener(),this._initEditorBridge()}_handleSelectionChange(e,n,r){var i,a;let s=(i=e[0])==null?void 0:i.range,l=this._renderManagerService.getRenderUnitById(n),u=l==null||(a=l.with(c.SheetSkeletonManagerService).getSkeletonParam(r))==null?void 0:a.skeleton;if(!u||!s)return;let d=u.getCellWithCoordByIndex(s.startRow,s.startColumn);if(((s.rangeType??t.RANGE_TYPE.NORMAL)!==t.RANGE_TYPE.NORMAL||s.endColumn-s.startColumn>0||s.endRow-s.startRow>0)&&!((d.isMerged||d.isMergedMainCell)&&t.Rectangle.equals(d.mergeInfo,s))){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(o.SetActiveCommentOperation.id);return}let f=d.actualRow,p=d.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(n,r,f,p)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(o.SetActiveCommentOperation.id);return}let m=this._sheetsThreadCommentModel.getByLocation(n,r,f,p);m&&this._commandService.executeCommand(o.SetActiveCommentOperation.id,{unitId:n,subUnitId:r,commentId:m})}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(e=>{if(this._isSwitchToCommenting)return;let t=this._sheetSelectionService.currentSelectionParam;t&&this._handleSelectionChange(e,t.unitId,t.sheetId)}))}_initEditorBridge(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(e=>{e.visible&&this._sheetsThreadCommentPopupService.hidePopup()}))}_initCommandListener(){this._commandService.onCommandExecuted(e=>{if(e.id===a.DeleteCommentMutation.id){let t=e.params,n=this._sheetsThreadCommentPopupService.activePopup;if(!n)return;let{unitId:r,subUnitId:i,commentId:a}=n;t.unitId===r&&t.subUnitId===i&&t.commentId===a&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async e=>{if(e){var n;let{unitId:i,subUnitId:o,commentId:s,trigger:l}=e,u=this._sheetsThreadCommentModel.getComment(i,o,s);if(!u||u.resolved)return;let d=(0,a.deserializeThreadCommentAnchor)(u.ref);if((d==null?void 0:d.kind)===a.ThreadCommentAnchorKind.SHEET_DRAWING)return;let p=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET);if(!p||p.getUnitId()!==i)return;this._isSwitchToCommenting=!0,((n=p.getActiveSheet())==null?void 0:n.getSheetId())!==o&&await this._commandService.executeCommand(r.SetWorksheetActiveOperation.id,{unitId:i,subUnitId:o}),this._isSwitchToCommenting=!1;let m=(0,f.singleReferenceToGrid)(u.ref),{row:h,column:g}=m;if(!this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[r.WorkbookCommentPermission],worksheetTypes:[r.WorksheetViewPermission],rangeTypes:[r.RangeProtectionPermissionViewPoint]},[{startRow:h,startColumn:g,endRow:h,endColumn:g}],i,o)||(await this._commandService.executeCommand(c.ScrollToRangeOperation.id,{range:{startRow:Math.max(m.row-1,0),endRow:m.row+1,startColumn:Math.max(m.column-1,0),endColumn:m.column+1}}),this._editorBridgeService.isVisible().visible))return;this._sheetsThreadCommentPopupService.showPopup({unitId:i,subUnitId:o,row:m.row,col:m.column,commentId:u.id,trigger:l})}else this._sheetsThreadCommentPopupService.hidePopup()}))}_initMarkSelection(){this.disposeWithMe((0,l.combineLatest)([this._threadCommentPanelService.activeCommentId$,this._threadCommentPanelService.hoveredCommentId$]).pipe((0,l.debounceTime)(100)).subscribe(([e,n])=>{var r,i;let a=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET),o=be(e,n,a==null?void 0:a.getUnitId(),a==null||(r=a.getActiveSheet())==null?void 0:r.getSheetId());if(!o){this._selectionShapeInfo&&=(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),null);return}let{unitId:s,subUnitId:c,commentId:l}=o;this._selectionShapeInfo&&=(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),null);let u=this._sheetsThreadCommentModel.getComment(s,c,l);if(!u)return;let{row:d,column:p}=(0,f.singleReferenceToGrid)(u.ref);if(Number.isNaN(d)||Number.isNaN(p))return null;let m=(i=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getSheetBySheetId(c),h=(m==null?void 0:m.getMergedCell(d,p))??{startColumn:p,endColumn:p,startRow:d,endRow:d},g=this._markSelectionService.addShape({range:h,style:{fill:`rgba(255, 189, 55, 0.35)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null},[],-1);g&&(this._selectionShapeInfo={...o,shapeId:g})}))}};Z=S([x(0,t.ICommandService),x(1,(0,t.Inject)(C)),x(2,(0,t.Inject)(i.SheetsThreadCommentModel)),x(3,(0,t.Inject)(o.ThreadCommentPanelService)),x(4,t.IUniverInstanceService),x(5,(0,t.Inject)(r.SheetPermissionCheckController)),x(6,c.IMarkSelectionService),x(7,(0,t.Inject)(r.SheetsSelectionsService)),x(8,c.IEditorBridgeService),x(9,u.IRenderManagerService)],Z);let Q=class extends t.Disposable{constructor(e,t){super(),this._menuManagerService=e,this._shortcutService=t,this._initMenu(),this._initShortcut()}_initShortcut(){this._shortcutService.registerShortcut(N)}_initMenu(){this._menuManagerService.mergeMenu(te)}};Q=S([x(0,s.IMenuManagerService),x(1,s.IShortcutService)],Q);let $=class extends t.Plugin{constructor(e=L,n,r,i,a){super(),this._config=e,this._injector=n,this._commandService=r,this._renderManagerService=i,this._configService=a;let{menu:o,...s}=(0,t.merge)({},L,this._config);o&&this._configService.setConfig(`menu`,o,{merge:!0}),this._configService.setConfig(I,s)}onStarting(){this._injector.add([J]),this._injector.get(J),[[Q],[W],[G],[X],[Z],[C],[K]].forEach(e=>{this._injector.add(e)}),[O,E,w,T].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(Q)}onReady(){this._injector.get(W)}onRendered(){this._renderManagerService.registerRenderModule(t.UniverInstanceType.UNIVER_SHEET,[Y]),this._injector.get(G),this._injector.get(X),this._injector.get(Z),this._injector.get(K)}};b($,`pluginName`,_),b($,`packageName`,ne),b($,`version`,re),b($,`type`,t.UniverInstanceType.UNIVER_SHEET),$=S([(0,t.DependentOn)(u.UniverRenderEnginePlugin,a.UniverThreadCommentPlugin,n.UniverDrawingPlugin,r.UniverSheetsPlugin,o.UniverThreadCommentUIPlugin,i.UniverSheetsThreadCommentPlugin,c.UniverSheetsUIPlugin),x(1,(0,t.Inject)(t.Injector)),x(2,(0,t.Inject)(t.ICommandService)),x(3,u.IRenderManagerService),x(4,t.IConfigService)],$),Object.defineProperty(e,"SheetsThreadCommentPopupService",{enumerable:!0,get:function(){return C}}),e.SheetsThreadCommentUIMenuSchema=te,e.ShowAddSheetCommentModalOperation=w,e.ToggleSheetCommentPanelOperation=T,Object.defineProperty(e,"UniverSheetsThreadCommentMobileUIPlugin",{enumerable:!0,get:function(){return q}}),Object.defineProperty(e,"UniverSheetsThreadCommentUIPlugin",{enumerable:!0,get:function(){return $}})});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiArSA=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`إدارة التعليقات`},permission:{commentErr:`ليس لديك إذن لاستخدام التعليقات.`},menu:{addComment:`إضافة تعليق`,commentManagement:`إدارة التعليقات`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiArSA=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`إدارة التعليقات`},permission:{commentErr:`ليس لديك إذن لاستخدام التعليقات.`},menu:{addComment:`إضافة تعليق`,openComments:`فتح التعليقات`,commentManagement:`إدارة التعليقات`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiCaES=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Gestió de comentaris`},permission:{commentErr:`No teniu permís per utilitzar comentaris.`},menu:{addComment:`Afegeix un comentari`,commentManagement:`Gestió de comentaris`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiCaES=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Gestió de comentaris`},permission:{commentErr:`No teniu permís per utilitzar comentaris.`},menu:{addComment:`Afegeix un comentari`,openComments:`Obre els comentaris`,commentManagement:`Gestió de comentaris`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiDeDE=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Kommentarverwaltung`},permission:{commentErr:`Sie haben keine Berechtigung, Kommentare zu verwenden.`},menu:{addComment:`Kommentar hinzufügen`,commentManagement:`Kommentarverwaltung`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiDeDE=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Kommentarverwaltung`},permission:{commentErr:`Sie haben keine Berechtigung, Kommentare zu verwenden.`},menu:{addComment:`Kommentar hinzufügen`,openComments:`Kommentare öffnen`,commentManagement:`Kommentarverwaltung`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiEnUS=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Comment Management`},permission:{commentErr:`You do not have permission to use comments.`},menu:{addComment:`Add Comment`,commentManagement:`Comment Management`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiEnUS=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Comment Management`},permission:{commentErr:`You do not have permission to use comments.`},menu:{addComment:`Add Comment`,openComments:`Open Comments`,commentManagement:`Comment Management`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiEsES=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Gestión de comentarios`},permission:{commentErr:`No tiene permiso para usar comentarios.`},menu:{addComment:`Añadir comentario`,commentManagement:`Gestión de comentarios`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiEsES=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Gestión de comentarios`},permission:{commentErr:`No tiene permiso para usar comentarios.`},menu:{addComment:`Añadir comentario`,openComments:`Abrir comentarios`,commentManagement:`Gestión de comentarios`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiFaIR=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`مدیریت نظر`},permission:{commentErr:`شما مجوز استفاده از نظرات را ندارید.`},menu:{addComment:`افزودن نظر`,commentManagement:`مدیریت نظر`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiFaIR=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`مدیریت نظر`},permission:{commentErr:`شما مجوز استفاده از نظرات را ندارید.`},menu:{addComment:`افزودن نظر`,openComments:`باز کردن نظرات`,commentManagement:`مدیریت نظر`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiFrFR=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Gestion des commentaires`},permission:{commentErr:`Vous n’avez pas l’autorisation d’utiliser les commentaires.`},menu:{addComment:`Ajouter un commentaire`,commentManagement:`Gestion des commentaires`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiFrFR=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Gestion des commentaires`},permission:{commentErr:`Vous n’avez pas l’autorisation d’utiliser les commentaires.`},menu:{addComment:`Ajouter un commentaire`,openComments:`Ouvrir les commentaires`,commentManagement:`Gestion des commentaires`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiIdID=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Manajemen Komentar`},permission:{commentErr:`Anda tidak memiliki izin untuk menggunakan komentar.`},menu:{addComment:`Tambah Komentar`,commentManagement:`Manajemen Komentar`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiIdID=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Manajemen Komentar`},permission:{commentErr:`Anda tidak memiliki izin untuk menggunakan komentar.`},menu:{addComment:`Tambah Komentar`,openComments:`Buka Komentar`,commentManagement:`Manajemen Komentar`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiItIT=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Gestione commenti`},permission:{commentErr:`Non hai l’autorizzazione per usare i commenti.`},menu:{addComment:`Aggiungi commento`,commentManagement:`Gestione commenti`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiItIT=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Gestione commenti`},permission:{commentErr:`Non hai l’autorizzazione per usare i commenti.`},menu:{addComment:`Aggiungi commento`,openComments:`Apri commenti`,commentManagement:`Gestione commenti`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiJaJP=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`コメント管理`},permission:{commentErr:`コメントを使用する権限がありません。`},menu:{addComment:`コメントを追加`,commentManagement:`コメント管理`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiJaJP=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`コメント管理`},permission:{commentErr:`コメントを使用する権限がありません。`},menu:{addComment:`コメントを追加`,openComments:`コメントを開く`,commentManagement:`コメント管理`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiKoKR=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`댓글 관리`},permission:{commentErr:`댓글을 사용할 권한이 없습니다.`},menu:{addComment:`댓글 추가`,commentManagement:`댓글 관리`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiKoKR=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`댓글 관리`},permission:{commentErr:`댓글을 사용할 권한이 없습니다.`},menu:{addComment:`댓글 추가`,openComments:`댓글 열기`,commentManagement:`댓글 관리`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiPlPL=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Zarządzanie komentarzami`},permission:{commentErr:`Nie masz uprawnień do używania komentarzy.`},menu:{addComment:`Dodaj komentarz`,commentManagement:`Zarządzanie komentarzami`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiPlPL=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Zarządzanie komentarzami`},permission:{commentErr:`Nie masz uprawnień do używania komentarzy.`},menu:{addComment:`Dodaj komentarz`,openComments:`Otwórz komentarze`,commentManagement:`Zarządzanie komentarzami`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiPtBR=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Gerenciamento de Comentários`},permission:{commentErr:`Você não tem permissão para usar comentários.`},menu:{addComment:`Adicionar Comentário`,commentManagement:`Gerenciamento de Comentários`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiPtBR=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Gerenciamento de Comentários`},permission:{commentErr:`Você não tem permissão para usar comentários.`},menu:{addComment:`Adicionar Comentário`,openComments:`Abrir comentários`,commentManagement:`Gerenciamento de Comentários`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiRuRU=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Управление комментариями`},permission:{commentErr:`У вас нет разрешения на использование комментариев.`},menu:{addComment:`Добавить комментарий`,commentManagement:`Управление комментариями`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiRuRU=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Управление комментариями`},permission:{commentErr:`У вас нет разрешения на использование комментариев.`},menu:{addComment:`Добавить комментарий`,openComments:`Открыть комментарии`,commentManagement:`Управление комментариями`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiSkSK=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Správa komentárov`},permission:{commentErr:`Nemáte povolenie používať komentáre.`},menu:{addComment:`Pridať komentár`,commentManagement:`Správa komentárov`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiSkSK=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Správa komentárov`},permission:{commentErr:`Nemáte povolenie používať komentáre.`},menu:{addComment:`Pridať komentár`,openComments:`Otvoriť komentáre`,commentManagement:`Správa komentárov`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiViVN=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Quản lý bình luận`},permission:{commentErr:`Bạn không có quyền sử dụng bình luận.`},menu:{addComment:`Thêm bình luận`,commentManagement:`Quản lý bình luận`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiViVN=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`Quản lý bình luận`},permission:{commentErr:`Bạn không có quyền sử dụng bình luận.`},menu:{addComment:`Thêm bình luận`,openComments:`Mở bình luận`,commentManagement:`Quản lý bình luận`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiZhCN=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`评论管理`},permission:{commentErr:`你没有权限使用评论。`},menu:{addComment:`添加评论`,commentManagement:`评论管理`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiZhCN=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`评论管理`},permission:{commentErr:`你没有权限使用评论。`},menu:{addComment:`添加评论`,openComments:`打开评论`,commentManagement:`评论管理`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiZhHK=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`評論管理`},permission:{commentErr:`你沒有權限使用評論。`},menu:{addComment:`新增評論`,commentManagement:`評論管理`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiZhHK=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`評論管理`},permission:{commentErr:`你沒有權限使用評論。`},menu:{addComment:`新增評論`,openComments:`開啟評論`,commentManagement:`評論管理`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiZhTW=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`評論管理`},permission:{commentErr:`你沒有權限使用評論。`},menu:{addComment:`新增評論`,commentManagement:`評論管理`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiZhTW=t())})(this,function(){return{"sheets-thread-comment-ui":{panel:{title:`評論管理`},permission:{commentErr:`你沒有權限使用評論。`},menu:{addComment:`新增評論`,openComments:`開啟評論`,commentManagement:`評論管理`}}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-thread-comment-ui",
3
- "version": "1.0.0-insiders.20260809-70eefdd",
3
+ "version": "1.0.0-rc.0",
4
4
  "private": false,
5
5
  "description": "Thread comment UI integration for Univer Sheets.",
6
6
  "author": "DreamNum Co., Ltd. <developer@univer.ai>",
@@ -58,25 +58,26 @@
58
58
  "rxjs": ">=7.0.0"
59
59
  },
60
60
  "dependencies": {
61
- "@univerjs/icons": "1.35.0",
62
- "@univerjs/core": "1.0.0-insiders.20260809-70eefdd",
63
- "@univerjs/engine-formula": "1.0.0-insiders.20260809-70eefdd",
64
- "@univerjs/sheets": "1.0.0-insiders.20260809-70eefdd",
65
- "@univerjs/sheets-thread-comment": "1.0.0-insiders.20260809-70eefdd",
66
- "@univerjs/engine-render": "1.0.0-insiders.20260809-70eefdd",
67
- "@univerjs/sheets-ui": "1.0.0-insiders.20260809-70eefdd",
68
- "@univerjs/thread-comment": "1.0.0-insiders.20260809-70eefdd",
69
- "@univerjs/ui": "1.0.0-insiders.20260809-70eefdd",
70
- "@univerjs/thread-comment-ui": "1.0.0-insiders.20260809-70eefdd"
61
+ "@univerjs/icons": "1.38.0",
62
+ "@univerjs/engine-formula": "1.0.0-rc.0",
63
+ "@univerjs/core": "1.0.0-rc.0",
64
+ "@univerjs/sheets": "1.0.0-rc.0",
65
+ "@univerjs/ui": "1.0.0-rc.0",
66
+ "@univerjs/sheets-ui": "1.0.0-rc.0",
67
+ "@univerjs/thread-comment": "1.0.0-rc.0",
68
+ "@univerjs/thread-comment-ui": "1.0.0-rc.0",
69
+ "@univerjs/drawing": "1.0.0-rc.0",
70
+ "@univerjs/sheets-thread-comment": "1.0.0-rc.0",
71
+ "@univerjs/engine-render": "1.0.0-rc.0"
71
72
  },
72
73
  "devDependencies": {
73
- "postcss": "^8.5.25",
74
+ "postcss": "^8.5.26",
74
75
  "react": "18.3.1",
75
76
  "rxjs": "^7.8.2",
76
77
  "tailwindcss": "3.4.18",
77
78
  "typescript": "^6.0.3",
78
- "vitest": "^4.1.10",
79
- "@univerjs-infra/shared": "1.0.0-beta.0"
79
+ "vitest": "^5.0.0",
80
+ "@univerjs-infra/shared": "1.0.0-rc.0"
80
81
  },
81
82
  "scripts": {
82
83
  "test": "vitest run",