@univerjs-pro/collaboration-client 0.4.1 → 0.4.2-nightly.202410301606
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/es/index.js +1 -1
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/controllers/collaboration/collaboration-entity.d.ts +5 -3
- package/lib/types/controllers/collaboration/collaboration-state.d.ts +32 -1
- package/lib/types/controllers/collaboration/utils/changeset-utils.d.ts +2 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/services/auth-server/util.d.ts +1 -0
- package/lib/types/services/collaboration-session/collaboration-session.d.ts +4 -4
- package/lib/types/services/ime-cache-transform/doc-transform-ime-cache.service.d.ts +1 -1
- package/lib/types/services/member/member.service.d.ts +39 -0
- package/lib/types/services/state-cache-transform/doc-transform-state-cache.service.d.ts +12 -0
- package/lib/types/services/sync-editing-collab-cursor/doc-sync-editing-collab-cursor.service.d.ts +1 -1
- package/lib/types/services/text-selection/doc-transform-selections.service.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +35 -31
- package/lib/cjs/index.js +0 -1
- package/lib/locale/en-US.json +0 -38
- package/lib/locale/fa-IR.json +0 -38
- package/lib/locale/ru-RU.json +0 -38
- package/lib/locale/vi-VN.json +0 -38
- package/lib/locale/zh-CN.json +0 -38
- package/lib/locale/zh-TW.json +0 -38
@@ -0,0 +1 @@
|
|
1
|
+
function _0x34e1(_0x36f5c3,_0x8eca8e){const _0x28087c=_0x2808();return _0x34e1=function(_0x34e1fa,_0x58a07f){_0x34e1fa=_0x34e1fa-0xce;let _0x3b0e6e=_0x28087c[_0x34e1fa];return _0x3b0e6e;},_0x34e1(_0x36f5c3,_0x8eca8e);}const _0x3ff659=_0x34e1;(function(_0x472b34,_0x1f86a1){const _0xeeec32=_0x34e1,_0x2f2540=_0x472b34();while(!![]){try{const _0x25fe8e=-parseInt(_0xeeec32(0xd0))/0x1*(-parseInt(_0xeeec32(0xe3))/0x2)+-parseInt(_0xeeec32(0xd2))/0x3+-parseInt(_0xeeec32(0xdd))/0x4+-parseInt(_0xeeec32(0xd3))/0x5*(-parseInt(_0xeeec32(0xd5))/0x6)+parseInt(_0xeeec32(0xd1))/0x7+parseInt(_0xeeec32(0xe0))/0x8+-parseInt(_0xeeec32(0xd8))/0x9;if(_0x25fe8e===_0x1f86a1)break;else _0x2f2540['push'](_0x2f2540['shift']());}catch(_0x33e56d){_0x2f2540['push'](_0x2f2540['shift']());}}}(_0x2808,0x4cb78));const e={'collab-client':{'tooltip':{'reconnect':_0x3ff659(0xd9)}},'collabStatus':{'fetchMiss':'Syncing\x20server\x20data...','conflict':_0x3ff659(0xce),'notCollab':_0x3ff659(0xd4),'synced':_0x3ff659(0xdf),'syncing':_0x3ff659(0xda),'offline':_0x3ff659(0xcf)},'session':{'connection-failed':_0x3ff659(0xe4),'will-retry':'Connection\x20failed,\x20we\x20retry\x20in\x20a\x20while.','room-full':_0x3ff659(0xd7),'collaboration-timeout':_0x3ff659(0xe5)},'conflict':{'title':_0x3ff659(0xe1),'content':_0x3ff659(0xdb)},'permission':{'title':_0x3ff659(0xe2),'content':_0x3ff659(0xdc)},'collaboration':{'single-unit':{'warning':_0x3ff659(0xde)},'closeRoom':_0x3ff659(0xd6)},'auth':{'needGotoLoginAlert':'Your\x20login\x20has\x20expired,\x20click\x20OK\x20to\x20re-login,\x20click\x20Cancel\x20to\x20save\x20your\x20local\x20edits.'}};function _0x2808(){const _0x1ef4a0=['500068yBwxZb','3004764kjwHpb','437382DuwKXA','774980tsfUdB','Local\x20file','12lgRFVS','Editing\x20privileges\x20were\x20revoked\x20because\x20the\x20collaborative\x20room\x20was\x20closed.','Collaboration\x20room\x20is\x20full.\x20You\x20edits\x20would\x20be\x20saved\x20locally.','4687002SkJSEM','Click\x20to\x20Reconnect','Syncing...','There\x20is\x20a\x20conflict\x20between\x20your\x20local\x20copy\x20and\x20the\x20copy\x20on\x20the\x20server.\x20Please\x20save\x20your\x20local\x20edits,\x20because\x20they\x20will\x20be\x20lost\x20when\x20you\x20reload\x20the\x20page.','Your\x20actions\x20are\x20conflicting\x20with\x20the\x20server\x27s\x20permissions.\x20Please\x20save\x20your\x20local\x20edits\x20elsewhere\x20as\x20they\x20will\x20be\x20discarded\x20after\x20refreshing\x20the\x20page.','2365596HPWcna','You\x20opened\x20the\x20same\x20file\x20in\x20another\x20tab.\x20In\x20case\x20of\x20data\x20missing,\x20you\x20cannot\x20edit\x20on\x20this\x20tab.','Synced','2663128eFtUWm','Collaboration\x20Conflict','Authentication\x20Error','2PzZrRh','Connection\x20failed,\x20please\x20check\x20your\x20network.','The\x20server\x20is\x20not\x20responding\x20to\x20your\x20collaboration\x20request.\x20Your\x20edits\x20would\x20be\x20saved\x20locally.','Edit\x20conflicts','Offline,\x20edits\x20would\x20be\x20save\x20on\x20local'];_0x2808=function(){return _0x1ef4a0;};return _0x2808();}export{e as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
const _0x3debbc=_0x390a;(function(_0x32902f,_0xec506d){const _0x23a010=_0x390a,_0x11c1b3=_0x32902f();while(!![]){try{const _0x441388=-parseInt(_0x23a010(0xd0))/0x1+-parseInt(_0x23a010(0xd9))/0x2+parseInt(_0x23a010(0xd6))/0x3+parseInt(_0x23a010(0xce))/0x4+parseInt(_0x23a010(0xde))/0x5*(-parseInt(_0x23a010(0xd1))/0x6)+parseInt(_0x23a010(0xd5))/0x7+parseInt(_0x23a010(0xd3))/0x8;if(_0x441388===_0xec506d)break;else _0x11c1b3['push'](_0x11c1b3['shift']());}catch(_0xfe7cd5){_0x11c1b3['push'](_0x11c1b3['shift']());}}}(_0x10ae,0x95388));function _0x10ae(){const _0x4edda7=['اعمال\x20شما\x20با\x20مجوزهای\x20سرور\x20تداخل\x20دارد.\x20لطفاً\x20ویرایش\x20های\x20محلی\x20خود\x20را\x20در\x20جای\x20دیگر\x20ذخیره\x20کنید\x20زیرا\x20پس\x20از\x20تازه\x20سازی\x20صفحه\x20از\x20بین\x20خواهند\x20رفت.','11237768iBUyVz','امتیازات\x20ویرایش\x20به\x20دلیل\x20بسته\x20شدن\x20اتاق\x20همکاری\x20لغو\x20شد.','1934562qSxfWY','2311314hniNMI','همگام\x20سازی','تداخل\x20همکاری','1789802mrdUSx','ورود\x20شما\x20منقضی\x20شده\x20است،\x20برای\x20ورود\x20مجدد\x20کلیک\x20کنید،\x20برای\x20ذخیره\x20ویرایش\x20های\x20محلی\x20خود\x20کلیک\x20کنید.','آفلاین،\x20ویرایش\x20ها\x20در\x20محلی\x20ذخیره\x20می\x20شوند','اتصال\x20ناموفق\x20بود،\x20ما\x20بعداً\x20دوباره\x20تلاش\x20می\x20کنیم.','برای\x20اتصال\x20مجدد\x20کلیک\x20کنید','5dllvLX','یک\x20تداخل\x20بین\x20نسخه\x20محلی\x20شما\x20و\x20نسخه\x20در\x20سرور\x20وجود\x20دارد.\x20لطفاً\x20ویرایش\x20های\x20محلی\x20خود\x20را\x20ذخیره\x20کنید،\x20زیرا\x20آنها\x20پس\x20از\x20بازیابی\x20صفحه\x20از\x20بین\x20خواهند\x20رفت.','اتاق\x20همکاری\x20پر\x20است.\x20شما\x20ویرایش\x20های\x20خود\x20را\x20در\x20محلی\x20ذخیره\x20خواهید\x20کرد.','1222500AnWaYA','پرونده\x20محلی','288510lRXixH','5775186QRvkSW'];_0x10ae=function(){return _0x4edda7;};return _0x10ae();}function _0x390a(_0x43d5c7,_0x50ca2f){const _0x10ae18=_0x10ae();return _0x390a=function(_0x390a0d,_0x323ccc){_0x390a0d=_0x390a0d-0xcd;let _0x1fb410=_0x10ae18[_0x390a0d];return _0x1fb410;},_0x390a(_0x43d5c7,_0x50ca2f);}const o={'collab-client':{'tooltip':{'reconnect':_0x3debbc(0xdd)}},'collabStatus':{'fetchMiss':'در\x20حال\x20همگام\x20سازی\x20داده\x20های\x20سرور...','conflict':'تداخل\x20ویرایش','notCollab':_0x3debbc(0xcf),'synced':_0x3debbc(0xd7),'syncing':'در\x20حال\x20همگام\x20سازی...','offline':_0x3debbc(0xdb)},'session':{'connection-failed':'اتصال\x20ناموفق\x20بود،\x20لطفا\x20شبکه\x20خود\x20را\x20بررسی\x20کنید.','will-retry':_0x3debbc(0xdc),'room-full':_0x3debbc(0xcd),'collaboration-timeout':'سرور\x20به\x20درخواست\x20همکاری\x20شما\x20پاسخ\x20نمی\x20دهد.\x20ویرایش\x20های\x20شما\x20در\x20محلی\x20ذخیره\x20می\x20شوند.'},'conflict':{'title':_0x3debbc(0xd8),'content':_0x3debbc(0xdf)},'permission':{'title':'خطای\x20اعتبارسنجی','content':_0x3debbc(0xd2)},'collaboration':{'single-unit':{'warning':'شما\x20همان\x20پرونده\x20را\x20در\x20یک\x20تب\x20دیگر\x20باز\x20کرده\x20اید.\x20در\x20صورت\x20عدم\x20وجود\x20داده،\x20نمی\x20توانید\x20در\x20این\x20تب\x20ویرایش\x20کنید.'},'closeRoom':_0x3debbc(0xd4)},'auth':{'needGotoLoginAlert':_0x3debbc(0xda)}};export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
function _0x5aa9(_0x4d20b5,_0x5d70eb){const _0x372c76=_0x372c();return _0x5aa9=function(_0x5aa972,_0x3d7812){_0x5aa972=_0x5aa972-0xf1;let _0x5a9ff2=_0x372c76[_0x5aa972];return _0x5a9ff2;},_0x5aa9(_0x4d20b5,_0x5d70eb);}(function(_0x43fb92,_0x26d156){const _0x4ab2c1=_0x5aa9,_0xdbbf02=_0x43fb92();while(!![]){try{const _0x6caba3=-parseInt(_0x4ab2c1(0xf9))/0x1*(parseInt(_0x4ab2c1(0xfa))/0x2)+-parseInt(_0x4ab2c1(0xf2))/0x3*(parseInt(_0x4ab2c1(0xf1))/0x4)+-parseInt(_0x4ab2c1(0xf3))/0x5+-parseInt(_0x4ab2c1(0xf4))/0x6+parseInt(_0x4ab2c1(0xfb))/0x7*(parseInt(_0x4ab2c1(0xf7))/0x8)+-parseInt(_0x4ab2c1(0xf5))/0x9*(-parseInt(_0x4ab2c1(0xf6))/0xa)+parseInt(_0x4ab2c1(0xf8))/0xb;if(_0x6caba3===_0x26d156)break;else _0xdbbf02['push'](_0xdbbf02['shift']());}catch(_0x3f549f){_0xdbbf02['push'](_0xdbbf02['shift']());}}}(_0x372c,0xc430f));import _0x3ab931 from'./en-US.js';const a=_0x3ab931;export{a as default};function _0x372c(){const _0x39d6c8=['9050296wxTxTm','26920234AOedew','27847KJXTqb','12RLZeSs','7yiGZNK','176EZBNRZ','89391lmtKQB','3685080oqXxzH','7861020ZmJdxS','198DGCGyE','341070tSftoy'];_0x372c=function(){return _0x39d6c8;};return _0x372c();}
|
@@ -0,0 +1 @@
|
|
1
|
+
function _0x59cd(_0xc5e42c,_0x49fd68){const _0xf8189f=_0xf818();return _0x59cd=function(_0x59cdf1,_0x1dbe08){_0x59cdf1=_0x59cdf1-0x111;let _0x26f530=_0xf8189f[_0x59cdf1];return _0x26f530;},_0x59cd(_0xc5e42c,_0x49fd68);}(function(_0x5eb3c3,_0x45103a){const _0x25dd5a=_0x59cd,_0x577691=_0x5eb3c3();while(!![]){try{const _0x5dd8c4=parseInt(_0x25dd5a(0x114))/0x1+-parseInt(_0x25dd5a(0x115))/0x2+-parseInt(_0x25dd5a(0x118))/0x3+parseInt(_0x25dd5a(0x119))/0x4*(-parseInt(_0x25dd5a(0x113))/0x5)+-parseInt(_0x25dd5a(0x112))/0x6*(parseInt(_0x25dd5a(0x116))/0x7)+-parseInt(_0x25dd5a(0x117))/0x8+parseInt(_0x25dd5a(0x11a))/0x9*(parseInt(_0x25dd5a(0x111))/0xa);if(_0x5dd8c4===_0x45103a)break;else _0x577691['push'](_0x577691['shift']());}catch(_0x402943){_0x577691['push'](_0x577691['shift']());}}}(_0xf818,0x2edf0));import _0x2b49eb from'./en-US.js';const a=_0x2b49eb;export{a as default};function _0xf818(){const _0x49d99f=['246Dwcand','690OaqQrE','333639IQyFIt','382186cWMZre','51919FyJKqo','2243424BBaSwH','82152uZImRF','6852XyQtVH','207171BXetjT','390RUePwV'];_0xf818=function(){return _0x49d99f;};return _0xf818();}
|
@@ -0,0 +1 @@
|
|
1
|
+
const _0x1e51b8=_0x2974;(function(_0x37ce21,_0x237290){const _0x598ab3=_0x2974,_0x531d80=_0x37ce21();while(!![]){try{const _0x12db5c=-parseInt(_0x598ab3(0x1be))/0x1+-parseInt(_0x598ab3(0x1bf))/0x2+-parseInt(_0x598ab3(0x1ba))/0x3*(-parseInt(_0x598ab3(0x1bb))/0x4)+-parseInt(_0x598ab3(0x1ca))/0x5+-parseInt(_0x598ab3(0x1c8))/0x6+parseInt(_0x598ab3(0x1c5))/0x7*(parseInt(_0x598ab3(0x1bd))/0x8)+parseInt(_0x598ab3(0x1c6))/0x9;if(_0x12db5c===_0x237290)break;else _0x531d80['push'](_0x531d80['shift']());}catch(_0x427a77){_0x531d80['push'](_0x531d80['shift']());}}}(_0x54d3,0xb3231));const o={'collab-client':{'tooltip':{'reconnect':_0x1e51b8(0x1b7)}},'collabStatus':{'fetchMiss':_0x1e51b8(0x1c3),'conflict':'编辑冲突','notCollab':_0x1e51b8(0x1b8),'synced':_0x1e51b8(0x1c4),'syncing':_0x1e51b8(0x1b6),'offline':'已离线,编辑将在本地缓存'},'session':{'connection-failed':_0x1e51b8(0x1cb),'will-retry':_0x1e51b8(0x1c2),'room-full':_0x1e51b8(0x1b9),'collaboration-timeout':_0x1e51b8(0x1c0)},'conflict':{'title':_0x1e51b8(0x1b5),'content':_0x1e51b8(0x1c1)},'permission':{'title':'权限错误','content':_0x1e51b8(0x1c7)},'collaboration':{'single-unit':{'warning':'你在另一个标签页打开了同一个文件。为了避免数据丢失,这个标签页的编辑行为将会被限制。'},'closeRoom':_0x1e51b8(0x1c9)},'auth':{'needGotoLoginAlert':_0x1e51b8(0x1bc)}};function _0x54d3(){const _0x224417=['619164JqaUCo','13047444Udrjbq','你的操作和服务器的权限存在冲突。请在别处保存你的本地编辑,本地编辑将在刷新页面后丢弃。','1122078XxONGr','由于协同房间被关闭,编辑权限被收回。','3614045JfdZdt','连接失败,请检查你的网络','协同冲突','保存中...','点击重新连接','本地文件','协同房间已满,你的编辑将在本地缓存','1593xXZeZK','2612zDFPYt','你的登录已过期,点击确认重新登陆,点击取消去保存你的本地编辑。','88wkTBsY','1011811RhmQlV','228106reGIoN','服务器未响应,你的编辑将在本地缓存','你的本地文档和服务器的文档存在冲突。请在别处保存你的本地编辑,本地编辑将在刷新页面后丢弃。','连接失败,将在一会儿之后重试连接','正在拉取服务端数据...','已同步'];_0x54d3=function(){return _0x224417;};return _0x54d3();}function _0x2974(_0x1feb01,_0x1963fa){const _0x54d3c1=_0x54d3();return _0x2974=function(_0x297444,_0x4646d0){_0x297444=_0x297444-0x1b5;let _0x2ff2df=_0x54d3c1[_0x297444];return _0x2ff2df;},_0x2974(_0x1feb01,_0x1963fa);}export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(_0x4047b8,_0x10a1e2){const _0x4d2303=_0x5c18,_0x261818=_0x4047b8();while(!![]){try{const _0x18a4e9=-parseInt(_0x4d2303(0x11b))/0x1+parseInt(_0x4d2303(0x11e))/0x2*(parseInt(_0x4d2303(0x114))/0x3)+parseInt(_0x4d2303(0x118))/0x4*(parseInt(_0x4d2303(0x115))/0x5)+parseInt(_0x4d2303(0x117))/0x6+-parseInt(_0x4d2303(0x113))/0x7*(parseInt(_0x4d2303(0x119))/0x8)+parseInt(_0x4d2303(0x11d))/0x9*(-parseInt(_0x4d2303(0x11c))/0xa)+parseInt(_0x4d2303(0x116))/0xb*(-parseInt(_0x4d2303(0x11a))/0xc);if(_0x18a4e9===_0x10a1e2)break;else _0x261818['push'](_0x261818['shift']());}catch(_0x5ebeb8){_0x261818['push'](_0x261818['shift']());}}}(_0x1835,0x24be2));function _0x5c18(_0x8e2d0d,_0x1d9558){const _0x18359f=_0x1835();return _0x5c18=function(_0x5c182a,_0x4384fd){_0x5c182a=_0x5c182a-0x113;let _0x1afc09=_0x18359f[_0x5c182a];return _0x1afc09;},_0x5c18(_0x8e2d0d,_0x1d9558);}import _0x43f83a from'./en-US.js';const a=_0x43f83a;function _0x1835(){const _0x271300=['292151XtrBOd','290WnNDKk','13707cerxCZ','196dJnAxT','469LSPAac','6702TfNWBS','102495wOluWc','32263tqrwcj','1015230iAeCmY','56oNkWFN','21784QKiYTz','24RKhChb'];_0x1835=function(){return _0x271300;};return _0x1835();}export{a as default};
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import { IDisposable, IMutationInfo, ICommandService, ILogService, Injector, IPermissionService, LocaleService, RxDisposable } from '@univerjs/core';
|
1
|
+
import { IDisposable, IMutationInfo, Nullable, ICommandService, ILogService, Injector, IPermissionService, LocaleService, RxDisposable } from '@univerjs/core';
|
2
2
|
import { UniverType } from '@univerjs/protocol';
|
3
3
|
import { Observable, BehaviorSubject } from 'rxjs';
|
4
|
-
import { Nullable } from 'vitest';
|
5
4
|
import { CollaborationSession } from '../../services/collaboration-session/collaboration-session';
|
6
5
|
import { CollaborationState, ICollaborationStateHandler, CollaborationStatus } from './collaboration-state';
|
7
6
|
import { DocStateChangeManagerService } from '@univerjs/docs-ui';
|
@@ -11,6 +10,7 @@ import { DocTransformIMECacheService } from '../../services/ime-cache-transform/
|
|
11
10
|
import { LocalCacheService } from '../../services/local-cache/local-cache.service';
|
12
11
|
import { SheetTransformSelectionsService } from '../../services/range-selection/sheet-transform-selections.service';
|
13
12
|
import { ISingleActiveUnitService } from '../../services/single-active-unit/single-active-unit.service';
|
13
|
+
import { DocTransformStateCacheService } from '../../services/state-cache-transform/doc-transform-state-cache.service';
|
14
14
|
import { DocSyncEditingCollabCursorService } from '../../services/sync-editing-collab-cursor/doc-sync-editing-collab-cursor.service';
|
15
15
|
import { DocTransformSelectionsService } from '../../services/text-selection/doc-transform-selections.service';
|
16
16
|
/**
|
@@ -60,6 +60,7 @@ export declare abstract class CollaborationEntity extends RxDisposable {
|
|
60
60
|
private _applyRemoteChangeset;
|
61
61
|
private _onRemoteACK;
|
62
62
|
private _onRemoteRejected;
|
63
|
+
private _onRemoteRetry;
|
63
64
|
private _onFetchMissResult;
|
64
65
|
private _toggleOffline;
|
65
66
|
private _toggleOnline;
|
@@ -73,9 +74,10 @@ export declare class DocCollaborationEntity extends CollaborationEntity {
|
|
73
74
|
readonly type: UniverType;
|
74
75
|
private readonly _docStateChangeManagerService;
|
75
76
|
private readonly _docTransformIMECacheService;
|
77
|
+
private readonly _docTransformStateCacheService;
|
76
78
|
private readonly _docTransformSelectionsService;
|
77
79
|
private readonly _docSyncEditingCollabCursorService;
|
78
|
-
constructor(unitID: string, type: UniverType, session: CollaborationSession, injector: Injector, localCacheService: LocalCacheService, compressMutationService: CompressMutationService, localeService: LocaleService, revisionService: RevisionService, _docStateChangeManagerService: DocStateChangeManagerService, _docTransformIMECacheService: DocTransformIMECacheService, _docTransformSelectionsService: DocTransformSelectionsService, _docSyncEditingCollabCursorService: DocSyncEditingCollabCursorService, logService: ILogService, commandService: ICommandService, messageService: IMessageService, permissionService: IPermissionService, singleActiveUnitService?: ISingleActiveUnitService);
|
80
|
+
constructor(unitID: string, type: UniverType, session: CollaborationSession, injector: Injector, localCacheService: LocalCacheService, compressMutationService: CompressMutationService, localeService: LocaleService, revisionService: RevisionService, _docStateChangeManagerService: DocStateChangeManagerService, _docTransformIMECacheService: DocTransformIMECacheService, _docTransformStateCacheService: DocTransformStateCacheService, _docTransformSelectionsService: DocTransformSelectionsService, _docSyncEditingCollabCursorService: DocSyncEditingCollabCursorService, logService: ILogService, commandService: ICommandService, messageService: IMessageService, permissionService: IPermissionService, singleActiveUnitService?: ISingleActiveUnitService);
|
79
81
|
protected _createHandler(): ICollaborationStateHandler;
|
80
82
|
protected _init(): Promise<CollaborationState>;
|
81
83
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { IMutationInfo, Nullable, ICommandService, IConfigService, ILogService, Injector, IPermissionService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
2
2
|
import { IAcknowledgedChangeset, IChangeset, ITransformService, RevisionService } from '@univerjs-pro/collaboration';
|
3
|
+
import { Observable } from 'rxjs';
|
3
4
|
import { ICollabEditingCursor } from '../../services/sync-editing-collab-cursor/doc-sync-editing-collab-cursor.service';
|
4
5
|
import { ICollaborativeUndoRedoService } from '../../services/undoredo/collaborative-undoredo.service';
|
5
6
|
import { UniverType } from '@univerjs/protocol';
|
@@ -16,16 +17,20 @@ export type MissingChangesetsHandler = (params: {
|
|
16
17
|
}) => void;
|
17
18
|
export type TransformSelectionsHandler = (changeset: IChangeset) => void;
|
18
19
|
export type TransformIMEHandler = (changeset: IChangeset) => void;
|
20
|
+
export type TransformStateHandler = (changeset: IChangeset) => void;
|
19
21
|
export type SyncEditingCollabCursorHandler = (params: ICollabEditingCursor) => void;
|
20
22
|
export type TransformRemoteChangesetByIMECache = (changeset: IChangeset) => IChangeset;
|
23
|
+
export type TransformRemoteChangesetByStateCache = (changeset: IChangeset) => IChangeset;
|
21
24
|
export interface ICollaborationStateHandler {
|
22
25
|
onStateChange: StateChangeHandler;
|
23
26
|
onSendChangeset: SendChangesetHandler;
|
24
27
|
onMissingChangesets: MissingChangesetsHandler;
|
25
28
|
onTransformSelections?: TransformSelectionsHandler;
|
26
29
|
onTransformIME?: TransformIMEHandler;
|
30
|
+
onTransformState?: TransformStateHandler;
|
27
31
|
onSyncEditingCollabCursor?: SyncEditingCollabCursorHandler;
|
28
32
|
onTransformRemoteChangesetByIMECache?: TransformRemoteChangesetByIMECache;
|
33
|
+
onTransformRemoteChangesetByStateCache?: TransformRemoteChangesetByStateCache;
|
29
34
|
}
|
30
35
|
export declare enum CollaborationStatus {
|
31
36
|
NOT_COLLAB = "not_collab",
|
@@ -80,6 +85,10 @@ export declare abstract class CollaborationState {
|
|
80
85
|
abstract onRemoteRej(config?: {
|
81
86
|
isPermissionRej: boolean;
|
82
87
|
}): CollaborationState;
|
88
|
+
/**
|
89
|
+
* Received a retry message from the server, meaning that some unexpected error occurred in server.
|
90
|
+
*/
|
91
|
+
abstract onRemoteRetry(changeset: IChangeset): CollaborationState;
|
83
92
|
abstract toggleOffline(): CollaborationState;
|
84
93
|
abstract toggleOnline(): CollaborationState;
|
85
94
|
/**
|
@@ -95,7 +104,9 @@ export declare abstract class CollaborationState {
|
|
95
104
|
/** Transform selections by calling the selection manager service. */
|
96
105
|
protected _transformSelections(changeset: IChangeset): void;
|
97
106
|
protected _transformIMECache(changeset: IChangeset): void | undefined;
|
107
|
+
protected _transformStateCache(changeset: IChangeset): void | undefined;
|
98
108
|
protected _transformRemoteChangesetByIMECache(changeset: IChangeset): IChangeset;
|
109
|
+
protected _transformRemoteChangesetByStateCache(changeset: IChangeset): IChangeset;
|
99
110
|
protected _syncEditingCollabCursor(changeset: IChangeset): void;
|
100
111
|
/** @internal */
|
101
112
|
_updateLocalCache(): void;
|
@@ -117,6 +128,7 @@ export declare class SyncedState extends CollaborationState {
|
|
117
128
|
private _onConflict;
|
118
129
|
onRemoteAck(): never;
|
119
130
|
onRemoteRej(): CollaborationState;
|
131
|
+
onRemoteRetry(): CollaborationState;
|
120
132
|
toggleOffline(): CollaborationState;
|
121
133
|
toggleOnline(): CollaborationState;
|
122
134
|
resend(): void;
|
@@ -142,6 +154,7 @@ export declare class PendingState extends CollaborationState {
|
|
142
154
|
onRemoteChangeset(changeset: IChangeset): CollaborationState;
|
143
155
|
onRemoteAck(): CollaborationState;
|
144
156
|
onRemoteRej(): CollaborationState;
|
157
|
+
onRemoteRetry(): CollaborationState;
|
145
158
|
toggleOffline(): CollaborationState;
|
146
159
|
toggleOnline(): CollaborationState;
|
147
160
|
/**
|
@@ -163,6 +176,9 @@ export declare class AwaitingState extends CollaborationState {
|
|
163
176
|
private readonly _logService;
|
164
177
|
private readonly _transformService;
|
165
178
|
readonly status = CollaborationStatus.AWAITING;
|
179
|
+
private _resendTimeout;
|
180
|
+
private _resendTimer;
|
181
|
+
private _sender;
|
166
182
|
constructor(unitID: string, type: UniverType, awaitingChangeset: IChangeset, handler: ICollaborationStateHandler, _injector: Injector, revisionService: RevisionService, localCacheService: LocalCacheService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService, undoRedoService: ICollaborativeUndoRedoService);
|
167
183
|
appendMutation(mutation: IMutationInfo): CollaborationState;
|
168
184
|
onRemoteChangeset(changeset: IChangeset): CollaborationState;
|
@@ -170,10 +186,13 @@ export declare class AwaitingState extends CollaborationState {
|
|
170
186
|
onRemoteRej(config?: {
|
171
187
|
isPermissionRej: boolean;
|
172
188
|
}): CollaborationState;
|
189
|
+
onRemoteRetry(changeset: IChangeset): CollaborationState;
|
173
190
|
toggleOffline(): CollaborationState;
|
174
191
|
toggleOnline(): CollaborationState;
|
175
192
|
resend(): void;
|
176
193
|
private _onConflict;
|
194
|
+
private _resendWithTimeout;
|
195
|
+
private _clearScheduledTask;
|
177
196
|
}
|
178
197
|
/**
|
179
198
|
* Some local mutations are sent to the server and waiting for acknowledgement, yet still some local mutations
|
@@ -184,17 +203,26 @@ export declare class AwaitingWithPendingState extends CollaborationState {
|
|
184
203
|
private readonly _logService;
|
185
204
|
private readonly _transformService;
|
186
205
|
readonly status = CollaborationStatus.AWAITING_WITH_PENDING;
|
187
|
-
|
206
|
+
private _resendTimeout;
|
207
|
+
private _resendTimer;
|
208
|
+
private _sender;
|
209
|
+
constructor(unitID: string, type: UniverType, awaitingChangeset: IChangeset, pendingMutations: IMutationInfo[], handler: ICollaborationStateHandler, timer: Observable<{
|
210
|
+
timeout: number;
|
211
|
+
reqId: number;
|
212
|
+
}> | undefined, _injector: Injector, revisionService: RevisionService, localCacheService: LocalCacheService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService, undoRedoService: ICollaborativeUndoRedoService);
|
188
213
|
appendMutation(mutation: IMutationInfo): CollaborationState;
|
189
214
|
onRemoteChangeset(changeset: IChangeset): CollaborationState;
|
190
215
|
onRemoteAck(changeset: IAcknowledgedChangeset): CollaborationState;
|
191
216
|
onRemoteRej(config?: {
|
192
217
|
isPermissionRej: boolean;
|
193
218
|
}): CollaborationState;
|
219
|
+
onRemoteRetry(changeset: IChangeset): CollaborationState;
|
194
220
|
toggleOffline(): CollaborationState;
|
195
221
|
toggleOnline(): CollaborationState;
|
196
222
|
resend(): void;
|
197
223
|
private _onConflict;
|
224
|
+
private _resendWithTimeout;
|
225
|
+
private _clearScheduledTask;
|
198
226
|
}
|
199
227
|
/**
|
200
228
|
* This state is special for handling collaboration conflicts.
|
@@ -213,6 +241,7 @@ export declare class ConflictState extends CollaborationState {
|
|
213
241
|
onRemoteChangeset(): CollaborationState;
|
214
242
|
onRemoteAck(): CollaborationState;
|
215
243
|
onRemoteRej(): CollaborationState;
|
244
|
+
onRemoteRetry(): CollaborationState;
|
216
245
|
toggleOffline(): CollaborationState;
|
217
246
|
toggleOnline(): CollaborationState;
|
218
247
|
resend(): void;
|
@@ -228,6 +257,7 @@ export declare class OfflineState extends CollaborationState {
|
|
228
257
|
onRemoteChangeset(_changeset: IChangeset): CollaborationState;
|
229
258
|
onRemoteAck(): CollaborationState;
|
230
259
|
onRemoteRej(): CollaborationState;
|
260
|
+
onRemoteRetry(): CollaborationState;
|
231
261
|
toggleOffline(): CollaborationState;
|
232
262
|
toggleOnline(): CollaborationState;
|
233
263
|
resend(): void;
|
@@ -265,6 +295,7 @@ export declare class FetchingMissState extends CollaborationState {
|
|
265
295
|
onRemoteRej(config?: {
|
266
296
|
isPermissionRej: boolean;
|
267
297
|
}): CollaborationState;
|
298
|
+
onRemoteRetry(): CollaborationState;
|
268
299
|
toggleOffline(): CollaborationState;
|
269
300
|
toggleOnline(): CollaborationState;
|
270
301
|
private _onConflict;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { IMutationInfo, IUniverInstanceService } from '@univerjs/core';
|
2
2
|
import { IChangeset, RevisionService } from '@univerjs-pro/collaboration';
|
3
|
+
import { Observable } from 'rxjs';
|
3
4
|
import { MemberService } from '../../../services/member/member.service';
|
4
5
|
export interface IAssembledChangeset {
|
5
6
|
changeset: IChangeset;
|
@@ -14,3 +15,4 @@ export declare const SINGLE_CHANGESET_MUTATIONS: Set<string>;
|
|
14
15
|
*/
|
15
16
|
export declare function assembleSheetChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
|
16
17
|
export declare function assembleDocChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
|
18
|
+
export declare function createTimerObservable$<T>(ms: number, options: T): Observable<T>;
|
package/lib/types/index.d.ts
CHANGED
@@ -16,6 +16,7 @@ export { UniverCollaborationClientPlugin } from './plugin';
|
|
16
16
|
export { CollaborationSessionService } from './services/collaboration-session/collaboration-session.service';
|
17
17
|
export { CollaborationSession, SessionStatus } from './services/collaboration-session/collaboration-session';
|
18
18
|
export type { ICollaborationSocket } from './services/socket/collaboration-socket.service';
|
19
|
+
export { type IUniverCollaborationClientConfig } from './controllers/config.schema';
|
19
20
|
export { CollaborationSocketService, ICollaborationSocketService, } from './services/socket/collaboration-socket.service';
|
20
21
|
export { LocalCacheService } from './services/local-cache/local-cache.service';
|
21
22
|
export { IURLService } from './services/url/url.service';
|
@@ -31,3 +32,4 @@ export { SnapshotServerOverHTTPService } from './services/snapshot-server/snapsh
|
|
31
32
|
export { CommentService } from './services/comment/comment.service';
|
32
33
|
export { type ISheetCollabCursorShapeProps, SheetCollabCursorShape } from './views/shapes/sheet-collab-cursor.shape';
|
33
34
|
export { ImageIoService } from './services/image-remote/image-io.service';
|
35
|
+
export { MemberService } from './services/member/member.service';
|
package/lib/types/plugin.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export declare function getAttachHeader(): string | undefined;
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { IConfigService, ILogService, LocaleService, RxDisposable
|
2
|
-
import { ITelemetryService } from '@univerjs/telemetry';
|
3
|
-
import { IBeforeCloseService, IMessageService } from '@univerjs/ui';
|
1
|
+
import { IDisposable, Nullable, IConfigService, ILogService, LocaleService, RxDisposable } from '@univerjs/core';
|
4
2
|
import { ICollaborationEvent } from '@univerjs-pro/collaboration';
|
5
3
|
import { Observable } from 'rxjs';
|
4
|
+
import { ICollaborationSocket } from '../socket/collaboration-socket.service';
|
5
|
+
import { ITelemetryService } from '@univerjs/telemetry';
|
6
|
+
import { IBeforeCloseService, IMessageService } from '@univerjs/ui';
|
6
7
|
import { CommentService } from '../comment/comment.service';
|
7
8
|
import { MemberService } from '../member/member.service';
|
8
|
-
import { ICollaborationSocket } from '../socket/collaboration-socket.service';
|
9
9
|
export declare enum SessionStatus {
|
10
10
|
IDLE = 0,
|
11
11
|
JOINING = 1,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { IChangeset, ITransformService } from '@univerjs-pro/collaboration';
|
2
2
|
import { Injector } from '@univerjs/core';
|
3
3
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
4
4
|
export declare class DocTransformIMECacheService {
|
@@ -19,9 +19,30 @@ export declare class MemberService extends Disposable {
|
|
19
19
|
* @deprecated please use userManagerService
|
20
20
|
*/
|
21
21
|
getCurrentUser(): Nullable<IUser>;
|
22
|
+
/**
|
23
|
+
* Update a member in a room(unit).
|
24
|
+
* @param roomID i.e. unitID.
|
25
|
+
* @param member member object to be updated.
|
26
|
+
*/
|
22
27
|
updateMember(roomID: string, member: IMember): void;
|
28
|
+
/**
|
29
|
+
* Remove a member from a room(unit).
|
30
|
+
* @param roomID i.e. unitID.
|
31
|
+
* @param memberID memberID of the member to be removed.
|
32
|
+
*/
|
23
33
|
removeMember(roomID: string, memberID: string): void;
|
34
|
+
/**
|
35
|
+
* Get RoomMember for a unit.
|
36
|
+
* @param roomID which is same with unitId.
|
37
|
+
* @returns RoomMember which is a object that manages members in a single room.
|
38
|
+
*/
|
24
39
|
getRoom(roomID: string): RoomMember | undefined;
|
40
|
+
/**
|
41
|
+
* Get a member in a room(unit).
|
42
|
+
* @param roomID i.e. unitID.
|
43
|
+
* @param memberID memberID of the member to be retrieved.
|
44
|
+
* @returns member object.
|
45
|
+
*/
|
25
46
|
getMember(roomID: string, memberID: string): IMember | undefined;
|
26
47
|
private _removeRoom;
|
27
48
|
dispose(): void;
|
@@ -32,7 +53,25 @@ export declare class MemberService extends Disposable {
|
|
32
53
|
export declare class RoomMember extends Disposable {
|
33
54
|
private readonly _members;
|
34
55
|
dispose(): void;
|
56
|
+
/**
|
57
|
+
* Update a member in the room(unit).
|
58
|
+
* @param member member object to be updated.
|
59
|
+
*/
|
35
60
|
updateMember(member: IMember): void;
|
61
|
+
/**
|
62
|
+
* Remove a member from the room(unit).
|
63
|
+
* @param memberID memberID of the member to be removed.
|
64
|
+
*/
|
36
65
|
removeMember(memberID: string): void;
|
66
|
+
/**
|
67
|
+
* Get a member by memberID.
|
68
|
+
* @param memberID
|
69
|
+
* @returns member object.
|
70
|
+
*/
|
37
71
|
getMember(memberID: string): IMember | undefined;
|
72
|
+
/**
|
73
|
+
* Get all members in the room(unit).
|
74
|
+
* @returns member object array.
|
75
|
+
*/
|
76
|
+
getAllMembers(): IMember[];
|
38
77
|
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { IChangeset, ITransformService } from '@univerjs-pro/collaboration';
|
2
|
+
import { Injector } from '@univerjs/core';
|
3
|
+
import { DocStateChangeManagerService } from '@univerjs/docs-ui';
|
4
|
+
export declare class DocTransformStateCacheService {
|
5
|
+
private readonly _injector;
|
6
|
+
private readonly _transformService;
|
7
|
+
private readonly _docStateChangeManagerService;
|
8
|
+
constructor(_injector: Injector, _transformService: ITransformService, _docStateChangeManagerService: DocStateChangeManagerService);
|
9
|
+
transformStateCache(changeset: IChangeset): void;
|
10
|
+
transformRemoteChangeset(changeset: IChangeset): IChangeset;
|
11
|
+
private _transformHistoryAndStateStack;
|
12
|
+
}
|
package/lib/types/services/sync-editing-collab-cursor/doc-sync-editing-collab-cursor.service.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { IUpdateCursor } from '@univerjs/protocol';
|
2
1
|
import { Nullable, RxDisposable } from '@univerjs/core';
|
3
2
|
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
3
|
+
import { IUpdateCursor } from '@univerjs/protocol';
|
4
4
|
export interface ICollabEditingCursor {
|
5
5
|
unitID: string;
|
6
6
|
memberID: string;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { IChangeset, ITransformService } from '@univerjs-pro/collaboration';
|
2
1
|
import { Injector } from '@univerjs/core';
|
2
|
+
import { IChangeset, ITransformService } from '@univerjs-pro/collaboration';
|
3
3
|
export declare class DocTransformSelectionsService {
|
4
4
|
private readonly _injector;
|
5
5
|
private readonly _transformService;
|