jupyter-docprovider 1.1.0rc0__tar.gz → 2.0.0__tar.gz
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.
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/PKG-INFO +3 -2
- jupyter_docprovider-2.0.0/jupyter_docprovider/_version.py +1 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/jupyter_docprovider/labextension/package.json +17 -17
- jupyter_docprovider-2.0.0/jupyter_docprovider/labextension/static/240.cc74569552563e7ef963.js +1 -0
- jupyter_docprovider-2.0.0/jupyter_docprovider/labextension/static/444.13de0fd44849e3f7d780.js +1 -0
- jupyter_docprovider-2.0.0/jupyter_docprovider/labextension/static/703.330942e5b860eabc4225.js +1 -0
- jupyter_docprovider-2.0.0/jupyter_docprovider/labextension/static/944.a13dc96a22c557e2f32c.js +1 -0
- jupyter_docprovider-2.0.0/jupyter_docprovider/labextension/static/remoteEntry.eefc7fe0a3fa35fba92b.js +1 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/jupyter_docprovider/labextension/static/third-party-licenses.json +3 -3
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/package.json +15 -15
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/__tests__/forkManager.spec.ts +4 -5
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/forkManager.ts +11 -13
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/ydrive.ts +36 -49
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider-extension/package.json +16 -16
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider-extension/src/filebrowser.ts +109 -194
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider-extension/src/forkManager.ts +7 -4
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider-extension/src/index.ts +3 -5
- jupyter_docprovider-1.1.0rc0/jupyter_docprovider/_version.py +0 -1
- jupyter_docprovider-1.1.0rc0/jupyter_docprovider/labextension/static/240.933a21c7535d4825ded5.js +0 -1
- jupyter_docprovider-1.1.0rc0/jupyter_docprovider/labextension/static/444.12adfae9a2b50e91531f.js +0 -1
- jupyter_docprovider-1.1.0rc0/jupyter_docprovider/labextension/static/703.daa1ff3cb47549ddde2b.js +0 -1
- jupyter_docprovider-1.1.0rc0/jupyter_docprovider/labextension/static/944.b85c55dff0f14165f872.js +0 -1
- jupyter_docprovider-1.1.0rc0/jupyter_docprovider/labextension/static/remoteEntry.a3cbb964a6031e5057cf.js +0 -1
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/.gitignore +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/LICENSE +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/README.md +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/install.json +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/jupyter_docprovider/__init__.py +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/jupyter_docprovider/labextension/static/576.21a3c1a9ebaebb58d346.js +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/jupyter_docprovider/labextension/static/style.js +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/babel.config.js +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/jest.config.js +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/TimelineSlider.tsx +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/__tests__/yprovider.spec.ts +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/awareness.ts +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/component.tsx +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/index.ts +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/notebookCellExecutor.ts +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/requests.ts +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/tokens.ts +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/yprovider.ts +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/style/base.css +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/style/index.css +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/style/index.js +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/style/slider.css +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/tsconfig.json +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/tsconfig.test.json +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider-extension/README.md +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider-extension/src/executor.ts +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider-extension/style/index.css +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider-extension/style/index.js +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider-extension/tsconfig.json +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/pyproject.toml +0 -0
- {jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: jupyter-docprovider
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: JupyterLab/Jupyter Notebook 7+ extension integrating collaborative shared models.
|
|
5
5
|
Project-URL: Documentation, https://jupyterlab-realtime-collaboration.readthedocs.io/
|
|
6
6
|
Project-URL: Repository, https://github.com/jupyterlab/jupyter-collaboration
|
|
@@ -64,6 +64,7 @@ License: # Licensing terms
|
|
|
64
64
|
|
|
65
65
|
# Copyright (c) Jupyter Development Team.
|
|
66
66
|
# Distributed under the terms of the Modified BSD License.
|
|
67
|
+
License-File: LICENSE
|
|
67
68
|
Classifier: Framework :: Jupyter
|
|
68
69
|
Classifier: Framework :: Jupyter :: JupyterLab
|
|
69
70
|
Classifier: Framework :: Jupyter :: JupyterLab :: 4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/docprovider-extension",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "JupyterLab - Collaborative Shared Models",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,29 +53,29 @@
|
|
|
53
53
|
"watch:labextension": "jupyter labextension watch ."
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jupyter/collaborative-drive": "^
|
|
57
|
-
"@jupyter/docprovider": "^
|
|
58
|
-
"@jupyter/ydoc": "^2.
|
|
59
|
-
"@jupyterlab/application": "^4.
|
|
60
|
-
"@jupyterlab/apputils": "^4.
|
|
61
|
-
"@jupyterlab/docregistry": "^4.
|
|
62
|
-
"@jupyterlab/filebrowser": "^4.
|
|
63
|
-
"@jupyterlab/fileeditor": "^4.
|
|
64
|
-
"@jupyterlab/logconsole": "^4.
|
|
65
|
-
"@jupyterlab/notebook": "^4.
|
|
66
|
-
"@jupyterlab/settingregistry": "^4.
|
|
67
|
-
"@jupyterlab/translation": "^4.
|
|
68
|
-
"@lumino/commands": "^2.
|
|
56
|
+
"@jupyter/collaborative-drive": "^4.0.0",
|
|
57
|
+
"@jupyter/docprovider": "^4.0.0",
|
|
58
|
+
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
|
|
59
|
+
"@jupyterlab/application": "^4.4.0",
|
|
60
|
+
"@jupyterlab/apputils": "^4.4.0",
|
|
61
|
+
"@jupyterlab/docregistry": "^4.4.0",
|
|
62
|
+
"@jupyterlab/filebrowser": "^4.4.0",
|
|
63
|
+
"@jupyterlab/fileeditor": "^4.4.0",
|
|
64
|
+
"@jupyterlab/logconsole": "^4.4.0",
|
|
65
|
+
"@jupyterlab/notebook": "^4.4.0",
|
|
66
|
+
"@jupyterlab/settingregistry": "^4.4.0",
|
|
67
|
+
"@jupyterlab/translation": "^4.4.0",
|
|
68
|
+
"@lumino/commands": "^2.3.2",
|
|
69
69
|
"y-protocols": "^1.0.5",
|
|
70
70
|
"y-websocket": "^1.3.15",
|
|
71
71
|
"yjs": "^13.5.40"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@jupyterlab/builder": "^4.
|
|
74
|
+
"@jupyterlab/builder": "^4.4.0",
|
|
75
75
|
"@types/react": "~18.3.1",
|
|
76
76
|
"npm-run-all": "^4.1.5",
|
|
77
77
|
"rimraf": "^4.1.2",
|
|
78
|
-
"typescript": "~5.
|
|
78
|
+
"typescript": "~5.1.6"
|
|
79
79
|
},
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
"_build": {
|
|
131
|
-
"load": "static/remoteEntry.
|
|
131
|
+
"load": "static/remoteEntry.eefc7fe0a3fa35fba92b.js",
|
|
132
132
|
"extension": "./extension",
|
|
133
133
|
"style": "./style"
|
|
134
134
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[240],{68:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(758),r=n.n(o),s=n(935),i=n.n(s)()(r());i.push([e.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-timelineSliderWrapper .jp-sliderContainer{\n display: flex;\n align-items: center;\n}\n\n.jp-Slider {\n height: 4.5px\n}\n\n#jp-slider-status-bar {\n display: flex;\n}\n\n.jp-timestampDisplay {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n}\n\n.jp-restoreBtnContainer {\n width: 192px;\n}\n\n.jp-ToolbarButtonComponent.jp-restoreBtn {\n cursor: pointer;\n color: var(--jp-layout-color2);\n width: 100%;\n background: var(--jp-accept-color-normal)\n}\n",""]);const a=i},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);o&&i[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},758:e=>{e.exports=function(e){return e[1]}},591:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var s={},i=[],a=0;a<e.length;a++){var c=e[a],l=o.base?c[0]+o.base:c[0],d=s[l]||0,h="".concat(l," ").concat(d);s[l]=d+1;var u=n(h),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var m=r(p,o);o.byIndex=a,t.splice(a,0,{identifier:h,updater:m,references:1})}i.push(h)}return i}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var s=o(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var a=n(s[i]);t[a].references--}for(var c=o(e,r),l=0;l<s.length;l++){var d=n(s[l]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=c}}},128:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},51:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},740:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},656:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},240:(e,t,n)=>{n.r(t),n.d(t,{ForkManager:()=>K,IForkManagerToken:()=>J,JUPYTER_COLLABORATION_FORK_EVENTS_URI:()=>q,NotebookCellServerExecutor:()=>l,ROOM_FORK_URL:()=>p,RtcContentProvider:()=>k,TimelineWidget:()=>B,WebSocketAwarenessProvider:()=>r,WebSocketProvider:()=>w,requestAPI:()=>m,requestDocSession:()=>f,requestDocumentTimeline:()=>v,requestUndoRedo:()=>g});var o=n(560);class r extends o.WebsocketProvider{constructor(e){super(e.url,e.roomID,e.awareness.doc,{awareness:e.awareness}),this._isDisposed=!1,this._awareness=e.awareness,this._user=e.user,this._user.ready.then((()=>this._onUserChanged(this._user))).catch((e=>console.error(e))),this._user.userChanged.connect(this._onUserChanged,this)}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._user.userChanged.disconnect(this._onUserChanged,this),this._isDisposed=!0,this.destroy())}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}var s=n(569),i=n(808),a=n(695),c=n(579);class l{constructor(e){var t;this._serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:a.ServerConnection.makeSettings()}async runCell({cell:e,notebook:t,notebookConfig:n,onCellExecuted:o,onCellExecutionScheduled:r,sessionContext:l,sessionDialogs:d,translator:h}){var u,p,m;const f=(h=null!=h?h:c.nullTranslator).load("jupyterlab");switch(e.model.type){case"markdown":e.rendered=!0,e.inputHidden=!1,o({cell:e,success:!0});break;case"code":if(l){if(l.isTerminating){await(0,s.showDialog)({title:f.__("Kernel Terminating"),body:f.__("The kernel for %1 appears to be terminating. You can not run any cell for now.",null===(u=l.session)||void 0===u?void 0:u.path),buttons:[s.Dialog.okButton()]});break}if(l.pendingInput)return await(0,s.showDialog)({title:f.__("Cell not executed due to pending input"),body:f.__("The cell has not been executed to avoid kernel deadlock as there is another pending input! Submit your pending input and try again."),buttons:[s.Dialog.okButton()]}),!1;if(l.hasNoKernel&&await l.startKernel()&&d&&await d.selectKernel(l),l.hasNoKernel)return e.model.sharedModel.transact((()=>{e.model.clearExecution()})),!0;const n=null===(m=null===(p=null==l?void 0:l.session)||void 0===p?void 0:p.kernel)||void 0===m?void 0:m.id,c=i.URLExt.join(this._serverSettings.baseUrl,`api/kernels/${n}/execute`),h=e.model.sharedModel.getId(),v=t.sharedModel.getState("document_id"),g={method:"POST",body:JSON.stringify({cell_id:h,document_id:v})};r({cell:e});let y=!1;try{y=(await a.ServerConnection.makeRequest(c,g,this._serverSettings)).ok}catch(t){if(o({cell:e,success:!1}),e.isDisposed)return!1;throw t}return o({cell:e,success:y}),!0}e.model.sharedModel.transact((()=>{e.model.clearExecution()}),!1)}return Promise.resolve(!0)}}const d="api/collaboration/session",h="api/collaboration/undo_redo",u="api/collaboration/timeline",p="api/collaboration/fork";async function m(e="",t={}){const n=a.ServerConnection.makeSettings(),o=i.URLExt.join(n.baseUrl,e);let r;try{r=await a.ServerConnection.makeRequest(o,t,n)}catch(e){throw new a.ServerConnection.NetworkError(e)}let s=await r.text();if(s.length>0)try{s=JSON.parse(s)}catch(e){console.error("Not a JSON response body.",r)}if(!r.ok)throw new a.ServerConnection.ResponseError(r,s.message||s);return s}async function f(e,t,n){const o=a.ServerConnection.makeSettings(),r=i.URLExt.join(o.baseUrl,d,encodeURIComponent(n)),s={method:"PUT",body:JSON.stringify({format:e,type:t})};let c;try{c=await a.ServerConnection.makeRequest(r,s,o)}catch(e){throw new a.ServerConnection.NetworkError(e)}let l=await c.text();if(l.length>0)try{l=JSON.parse(l)}catch(e){console.log("Not a JSON response body.",c)}if(!c.ok)throw new a.ServerConnection.ResponseError(c,l.message||l);return l}async function v(e,t,n){const o=a.ServerConnection.makeSettings();let r=i.URLExt.join(o.baseUrl,u,n);r=r.concat(`?format=${e}&&type=${t}`);const s={method:"GET"};let c;try{c=await a.ServerConnection.makeRequest(r,s,o)}catch(e){throw new a.ServerConnection.NetworkError(e)}return c}async function g(e,t,n,o){const r=a.ServerConnection.makeSettings();let s=i.URLExt.join(r.baseUrl,h,encodeURIComponent(e));s=s.concat(`?action=${t}&&steps=${n}&&forkRoom=${o}`);const c={method:"PUT"};let l;try{l=await a.ServerConnection.makeRequest(s,c,r)}catch(e){throw new a.ServerConnection.NetworkError(e)}let d=await l.text();if(d.length>0)try{d=JSON.parse(d)}catch(e){console.log("Not a JSON response body.",l)}if(!l.ok)throw new a.ServerConnection.ResponseError(l,d.message||d);return d}var y=n(602),_=n(262);class w{constructor(e){this._onConnectionClosed=e=>{1003===e.code&&(console.error("Document provider closed:",e.reason),(0,s.showErrorMessage)(this._trans.__("Document session error"),e.reason,[s.Dialog.okButton()]),this._sharedModel.dispose())},this._onSync=e=>{e&&(this._yWebsocketProvider&&(this._yWebsocketProvider.off("sync",this._onSync),this._sharedModel.ydoc.getMap("state").set("document_id",this._yWebsocketProvider.roomname)),this._ready.resolve())},this._ready=new _.PromiseDelegate,this._isDisposed=!1,this._path=e.path,this._contentType=e.contentType,this._format=e.format,this._serverUrl=e.url,this._sharedModel=e.model,this._awareness=e.model.awareness,this._yWebsocketProvider=null,this._trans=e.translator;const t=e.user;t.ready.then((()=>{this._onUserChanged(t)})).catch((e=>console.error(e))),t.userChanged.connect(this._onUserChanged,this),this._connect().catch((e=>console.warn(e)))}get isDisposed(){return this._isDisposed}get ready(){return this._ready.promise}get contentType(){return this._contentType}get format(){return this._format}dispose(){var e,t,n;this.isDisposed||(this._isDisposed=!0,null===(e=this._yWebsocketProvider)||void 0===e||e.off("connection-close",this._onConnectionClosed),null===(t=this._yWebsocketProvider)||void 0===t||t.off("sync",this._onSync),null===(n=this._yWebsocketProvider)||void 0===n||n.destroy(),this._disconnect(),y.Signal.clearData(this))}async reconnect(){this._disconnect(),this._connect()}async _connect(){const e=await f(this._format,this._contentType,this._path);this._yWebsocketProvider=new o.WebsocketProvider(this._serverUrl,`${e.format}:${e.type}:${e.fileId}`,this._sharedModel.ydoc,{disableBc:!0,params:{sessionId:e.sessionId},awareness:this._awareness}),this._yWebsocketProvider.on("sync",this._onSync),this._yWebsocketProvider.on("connection-close",this._onConnectionClosed)}async connectToForkDoc(e,t){this._disconnect(),this._yWebsocketProvider=new o.WebsocketProvider(this._serverUrl,e,this._sharedModel.ydoc,{disableBc:!0,params:{sessionId:t},awareness:this._awareness})}get wsProvider(){return this._yWebsocketProvider}_disconnect(){var e,t,n;null===(e=this._yWebsocketProvider)||void 0===e||e.off("connection-close",this._onConnectionClosed),null===(t=this._yWebsocketProvider)||void 0===t||t.off("sync",this._onSync),null===(n=this._yWebsocketProvider)||void 0===n||n.destroy(),this._yWebsocketProvider=null}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}const S="true"===i.PageConfig.getOption("disableRTC");class k extends a.RestContentProvider{constructor(e){super(e),this._onCreate=(e,t)=>{var n,o;if("string"==typeof e.format)try{const r=new w({url:i.URLExt.join(this._serverSettings.wsUrl,"api/collaboration/room"),path:e.path,format:e.format,contentType:e.contentType,model:t,user:this._user,translator:this._trans}),s=((null===(n=this._globalAwareness)||void 0===n?void 0:n.getLocalState())||{}).documents||[];s.includes(e.path)||(s.push(e.path),null===(o=this._globalAwareness)||void 0===o||o.setLocalStateField("documents",s));const a=`${e.format}:${e.contentType}:${e.path}`;this._providers.set(a,r),t.changed.connect((async(n,o)=>{var r;if(!o.stateChange)return;const s=o.stateChange.filter((e=>"hash"===e.name));if(0===s.length)return;s.length>1&&console.error("Unexpected multiple changes to hash value in a single transaction");const i=s[0],a=null!==(r=t.state.path)&&void 0!==r?r:e.path,c=await this.get(a,{content:!1});this._ydriveFileChanged.emit({type:"save",newValue:{...c,hash:i.newValue},oldValue:{hash:i.oldValue}})})),t.disposed.connect((()=>{var t,n;const o=this._providers.get(a);o&&(o.dispose(),this._providers.delete(a));const r=((null===(t=this._globalAwareness)||void 0===t?void 0:t.getLocalState())||{}).documents||[],s=r.indexOf(e.path);s>-1&&r.splice(s,1),null===(n=this._globalAwareness)||void 0===n||n.setLocalStateField("documents",r)}))}catch(t){console.error(`Failed to open websocket connection for ${e.path}.\n:${t}`)}},this._ydriveFileChanged=new y.Signal(this),this._user=e.user,this._trans=e.trans,this._globalAwareness=e.globalAwareness,this._serverSettings=e.serverSettings,this.sharedModelFactory=new b(this._onCreate),this._providers=new Map}get providers(){return this._providers}async get(e,t){if(t&&t.format&&t.type){const n=`${t.format}:${t.type}:${e}`,o=this._providers.get(n);if(o){const[n]=await Promise.all([super.get(e,{...t,content:!1}),o.ready]);return{...n,format:t.format}}}return super.get(e,t)}async save(e,t={}){if(t.format&&t.type){const n=`${t.format}:${t.type}:${e}`;if(this._providers.get(n)){const n={type:t.type,format:t.format,content:!1};return this.get(e,n)}}return super.save(e,t)}get fileChanged(){return this._ydriveFileChanged}}class b{constructor(e){this._onCreate=e,this.collaborative=!S,this.documentFactories=new Map}registerDocumentFactory(e,t){if(this.documentFactories.has(e))throw new Error(`The content type ${e} already exists`);this.documentFactories.set(e,t)}createNew(e){if("string"==typeof e.format){if(this.collaborative&&e.collaborative&&this.documentFactories.has(e.contentType)){const t=this.documentFactories.get(e.contentType)(e);return this._onCreate(e,t),t}}else console.warn(`Only defined format are supported; got ${e.format}.`)}}var C=n(345),T=n.n(C),E=n(591),x=n.n(E),R=n(740),U=n.n(R),D=n(128),P=n.n(D),$=n(855),N=n.n($),j=n(51),I=n.n(j),L=n(656),M=n.n(L),F=n(68),A={};A.styleTagTransform=M(),A.setAttributes=N(),A.insert=P().bind(null,"head"),A.domAPI=U(),A.insertStyleElement=I(),x()(F.A,A),F.A&&F.A.locals&&F.A.locals;var W=n(989);const O=({apiURL:e,provider:t,contentType:n,format:o,documentTimelineUrl:r})=>{const[i,a]=(0,C.useState)({roomId:"",timestamps:[],forkRoom:"",sessionId:""}),[c,l]=(0,C.useState)(i.timestamps.length-1),[d,h]=(0,C.useState)(!1),[u,p]=(0,C.useState)(!1),m=(0,C.useRef)(!0),y=(0,C.useRef)(!0),_=(0,C.useRef)(null);function w(e){try{const t=new URL(e).pathname,n=t.lastIndexOf(r);if(-1===n)throw new Error(`API segment "${r}" not found in URL.`);return t.slice(n+r.length)}catch(e){return console.error("Invalid URL or unable to extract filename:",e),""}}return T().createElement("div",{className:"jp-sliderContainer"},T().createElement("div",{onClick:()=>{!async function(r){try{if(m.current){const i=await v(o,n,r);if(!i.ok)throw 404===i.status?new Error("Not found"):503===i.status?new Error("WebSocket closed"):new Error(`Failed to fetch data: ${i.statusText}`);const c=await i.text();let d={roomId:"",timestamps:[],forkRoom:"",sessionId:""};return c&&(s.Notification.warning("Document is now in read-only mode. Changes will not be saved.",{autoClose:2500}),d=JSON.parse(c),a(d),l(d.timestamps.length-1),t.connectToForkDoc(d.forkRoom,d.sessionId),_.current=await f(o,n,w(e))),h(!0),m.current=!1,d}}catch(e){console.error("Error fetching data:",e)}}(w(e))},className:"jp-mod-highlighted",title:"Document Timeline"},T().createElement(W.historyIcon.react,{marginRight:"4px"})),d&&T().createElement("div",{className:"jp-timestampDisplay"},T().createElement("input",{type:"range",min:0,max:i.timestamps.length-1,value:c,onChange:async e=>{const t=parseInt(e.target.value),n=Math.abs(t-c);try{const e=function(e){return e<c?"undo":"redo"}(t);if(l(t),y.current&&(p(!0),y.current=!1),!_.current)return void console.error("Session is not initialized");await g(`${_.current.format}:${_.current.type}:${_.current.fileId}`,e,n,i.forkRoom)}catch(e){console.error("Error fetching or applying updates:",e)}},className:"jp-Slider"}),T().createElement("div",null,T().createElement("strong",null,w(e).split("/").pop()," ")," "),u&&T().createElement("div",{className:"jp-restoreBtnContainer"},T().createElement("button",{onClick:async()=>{if(!_.current)return void console.error("Session is not initialized");const e=await g(`${_.current.format}:${_.current.type}:${_.current.fileId}`,"restore",0,i.forkRoom);200===e.code?(s.Notification.success(e.status,{autoClose:4e3}),t.reconnect(),h(!1),m.current=!0):s.Notification.error(e.status,{autoClose:4e3})},className:"jp-ToolbarButtonComponent jp-restoreBtn"},"Restore version"," ",(e=>{const t=new Date(1e3*e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`})(i.timestamps[c])))))};class B extends s.ReactWidget{constructor(e,t,n,o,r){super(),this.apiURL=e,this.provider=t,this.contentType=n,this.format=o,this.documentTimelineUrl=r,this.addClass("jp-timelineSliderWrapper")}render(){return C.createElement(O,{key:this.apiURL,apiURL:this.apiURL,provider:this.provider,contentType:this.contentType,format:this.format,documentTimelineUrl:this.documentTimelineUrl})}updateContent(e,t){this.apiURL=e,this.provider=t,this.contentType=this.provider.contentType,this.format=this.provider.format,this.update()}}const J=new _.Token("@jupyter/docprovider:IForkManagerToken"),q="https://schema.jupyter.org/jupyter_collaboration/fork/v1";class K{constructor(e){this._disposed=!1,this._forkAddedSignal=new y.Signal(this),this._forkDeletedSignal=new y.Signal(this);const{contentProvider:t,eventManager:n}=e;this._contentProvider=t,this._eventManager=n,this._eventManager.stream.connect(this._handleEvent,this)}get isDisposed(){return this._disposed}get forkAdded(){return this._forkAddedSignal}get forkDeleted(){return this._forkDeletedSignal}dispose(){var e;this._disposed||(null===(e=this._eventManager)||void 0===e||e.stream.disconnect(this._handleEvent),this._disposed=!0)}async createFork(e){const{rootId:t,title:n,description:o,synchronize:r}=e,s={method:"PUT",body:JSON.stringify({title:n,description:o,synchronize:r})},a=i.URLExt.join(p,t);return await m(a,s)}async getAllForks(e){const t=i.URLExt.join(p,e);return await m(t,{method:"GET"})}async deleteFork(e){const{forkId:t,merge:n}=e,o=i.URLExt.join(p,t),r=i.URLExt.objectToQueryString({merge:n});await m(`${o}${r}`,{method:"DELETE"})}getProvider(e){const{documentPath:t,format:n,type:o}=e,r=this._contentProvider;if(r){const e=t;return r.providers.get(`${n}:${o}:${e}`)}}_handleEvent(e,t){if(t.schema_id===q)switch(t.action){case"create":this._forkAddedSignal.emit(t);break;case"delete":this._forkDeletedSignal.emit(t)}}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[444],{444:(e,o,n)=>{n.r(o),n.d(o,{ICollaborativeContentProvider:()=>t,IGlobalAwareness:()=>a});var r=n(262);const t=new r.Token("@jupyter/collaboration-extension:ICollaborativeContentProvider"),a=new r.Token("@jupyter/collaboration:IGlobalAwareness")}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[703],{703:(e,t,o)=>{o.r(t),o.d(t,{default:()=>k});var r=o(569),n=o(256),i=o(319),a=o(739),s=o(191),l=o(369),d=o(507),c=o(579),u=o(0),v=o(726),p=o(570),g=o(808);const h="api/collaboration/timeline",b="The file %1 has been opened with two different views. This is not supported. Please close this view; otherwise, some of your edits may not be saved properly.",y={id:"@jupyter/docprovider-extension:content-provider",description:"The RTC content provider",provides:v.ICollaborativeContentProvider,requires:[c.ITranslator],optional:[v.IGlobalAwareness],activate:(e,t,o)=>{const r=t.load("jupyter_collaboration"),n=e.serviceManager.contents.defaultDrive;if(!n)throw Error("Cannot initialize content provider: default drive property not accessible on contents manager instance.");const i=n.contentProviderRegistry;if(!i)throw Error("Cannot initialize content provider: no content provider registry.");const a=new p.RtcContentProvider({apiEndpoint:"/api/contents",serverSettings:n.serverSettings,user:e.serviceManager.user,trans:r,globalAwareness:o});return i.register("rtc",a),a}},m={id:"@jupyter/docprovider-extension:yfile",description:"Plugin to register the shared model factory for the content type 'file'",autoStart:!0,requires:[v.ICollaborativeContentProvider,a.IEditorWidgetFactory],activate:(e,t,o)=>{t.sharedModelFactory.registerDocumentFactory("file",(()=>new u.YFile)),o.contentProviderId="rtc"}},f={id:"@jupyter/docprovider-extension:ynotebook",description:"Plugin to register the shared model factory for the content type 'notebook'",autoStart:!0,requires:[v.ICollaborativeContentProvider,l.INotebookWidgetFactory],optional:[d.ISettingRegistry],activate:(e,t,o,r)=>{let n=!0;r&&r.load("@jupyterlab/notebook-extension:tracker").then((e=>{const t=e=>{var t;const o=null==e?void 0:e.get("experimentalEnableDocumentWideUndoRedo").composite;n=null===(t=!o)||void 0===t||t};t(e),e.changed.connect((e=>t(e)))})),t.sharedModelFactory.registerDocumentFactory("notebook",(()=>new u.YNotebook({disableDocumentWideUndoRedo:n}))),o.contentProviderId="rtc"}},w={id:"@jupyter/docprovider-extension:statusBarTimeline",description:"Plugin to add a timeline slider to the status bar",autoStart:!0,requires:[i.IStatusBar,v.ICollaborativeContentProvider],activate:async(e,t,o)=>{try{let r=null,i=null;const a=async(t,r)=>{if(!r)return;i&&(i.dispose(),i=null);const[a,s]=r.split(":"),l=o.providers.get(`${a}:${s}:${t}`);if(!l)return;const d=l,c=g.URLExt.join(e.serviceManager.serverSettings.baseUrl,h,t);i=new p.TimelineWidget(c,d,d.contentType,d.format,h);const u=document.getElementById("jp-slider-status-bar");u&&!i.isAttached&&n.Widget.attach(i,u)};e.shell.currentChanged&&e.shell.currentChanged.connect((async(e,t)=>{const o=t.newValue;i&&(i.dispose(),i=null),o&&"context"in o&&(await o.context.ready,await a(o.context.path,o.context.model.sharedModel.getState("document_id")))})),t&&(r||(r=new n.Widget,r.addClass("jp-StatusBar-GroupItem"),r.addClass("jp-mod-highlighted"),r.id="jp-slider-status-bar",t.registerStatusItem("jp-slider-status-bar",{item:r,align:"left",rank:4,isActive:()=>{var t,o;const r=e.shell.currentWidget;return(null===(o=null===(t=null==r?void 0:r.context)||void 0===t?void 0:t.model)||void 0===o?void 0:o.collaborative)||!1}})))}catch(e){console.error("Failed to activate statusBarTimeline plugin:",e)}}},k=[y,m,f,{id:"@jupyter/docprovider-extension:logger",description:"A logging plugin for debugging purposes.",autoStart:!0,optional:[s.ILoggerRegistry,a.IEditorTracker,l.INotebookTracker,c.ITranslator],activate:(e,t,o,n,i)=>{const a=(null!=i?i:c.nullTranslator).load("jupyter_collaboration"),s="https://schema.jupyter.org/jupyter_collaboration/session/v1";if(!t)return void e.serviceManager.events.stream.connect(((e,t)=>{var o,n;t.schema_id===s&&(console.debug(`[${t.room}(${t.path})] ${null!==(o=t.action)&&void 0!==o?o:""}: ${null!==(n=t.msg)&&void 0!==n?n:""}`),"WARNING"===t.level&&(0,r.showDialog)({title:a.__("Warning"),body:a.__(b,t.path),buttons:[r.Dialog.okButton()]}))}));const l=new Map,d=(e,o)=>{const r=t.getLogger(o.context.path);l.set(o.context.localPath,r),o.disposed.connect((e=>{l.delete(e.context.localPath)}))};o&&o.widgetAdded.connect(d),n&&n.widgetAdded.connect(d),(async()=>{var t,o;const{events:n}=e.serviceManager;for await(const e of n.stream)if(e.schema_id===s){const n=l.get(e.path);null==n||n.log({type:"text",level:e.level.toLowerCase(),data:`[${e.room}] ${null!==(t=e.action)&&void 0!==t?t:""}: ${null!==(o=e.msg)&&void 0!==o?o:""}`}),"WARNING"===e.level&&(0,r.showDialog)({title:a.__("Warning"),body:a.__(b,e.path),buttons:[r.Dialog.warnButton({label:a.__("Ok")})]})}})()}},{id:"@jupyter/docprovider-extension:notebook-cell-executor",description:"Add notebook cell executor that uses REST API instead of kernel protocol over WebSocket.",autoStart:!0,provides:l.INotebookCellExecutor,activate:e=>"true"===g.PageConfig.getOption("serverSideExecution")?new p.NotebookCellServerExecutor({serverSettings:e.serviceManager.serverSettings}):Object.freeze({runCell:l.runCell})},w,{id:"@jupyter/docprovider-extension:forkManager",autoStart:!0,requires:[v.ICollaborativeContentProvider],provides:p.IForkManagerToken,activate:(e,t)=>{const o=e.serviceManager.events;return new p.ForkManager({contentProvider:t,eventManager:o})}}]}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[944],{78:(n,e,o)=>{o.d(e,{A:()=>u});var r=o(758),t=o.n(r),a=o(935),i=o.n(a),l=o(875),p=o(28),s=o(921),c=i()(t());c.i(l.A),c.i(p.A),c.i(s.A),c.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-shared-link-body {\n user-select: none;\n}\n",""]);const u=c},875:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-MenuBar-label {\n margin-left: 25px;\n}\n\n.jp-MenuBar-anonymousIcon span {\n width: 24px;\n text-align: center;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-MenuBar-anonymousIcon,\n.jp-MenuBar-imageIcon {\n position: absolute;\n top: 1px;\n left: 8px;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n vertical-align: middle;\n border-radius: 100%;\n}\n\n.jp-MenuBar-imageIcon img {\n width: 24px;\n border-radius: 100%;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserMenu-caretDownIcon {\n height: 22px;\n position: relative;\n top: 15%;\n}\n",""]);const l=i},28:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/************************************************************\n Main Panel\n*************************************************************/\n\n.jp-RTCPanel {\n min-width: var(--jp-sidebar-min-width) !important;\n color: var(--jp-ui-font-color1);\n background: var(--jp-layout-color1);\n font-size: var(--jp-ui-font-size1);\n}\n\n/************************************************************\n User Info Panel\n*************************************************************/\n.jp-UserInfoPanel {\n display: flex;\n flex-direction: column;\n max-height: 140px;\n padding-top: 3px;\n}\n\n.jp-UserInfo-Container {\n margin: 20px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.jp-UserInfo-Icon {\n margin: auto;\n width: 50px;\n height: 50px;\n border-radius: 50px;\n display: inline-flex;\n align-items: center;\n}\n\n.jp-UserInfo-Icon span {\n margin: auto;\n text-align: center;\n font-size: 25px;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserInfo-Info {\n margin: 20px;\n display: inline-flex;\n flex-direction: column;\n}\n\n.jp-UserInfo-Info label {\n font-weight: bold;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserInfo-Info input {\n text-decoration: none;\n border-top: none;\n border-left: none;\n border-right: none;\n border-color: var(--jp-ui-font-color1);\n border-width: 0.5px;\n background-color: transparent;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n/************************************************************\n Collaborators Info Panel\n*************************************************************/\n\n.jp-CollaboratorsPanel {\n overflow-y: auto;\n}\n\n.jp-CollaboratorsList {\n flex-direction: column;\n display: flex;\n z-index: 1000;\n}\n\n.jp-CollaboratorHeader {\n padding: 10px;\n display: flex;\n align-items: center;\n font-size: var(--jp-ui-font-size0);\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-CollaboratorHeader > span {\n padding-left: 7px;\n}\n\n.jp-ClickableCollaborator:hover {\n cursor: pointer;\n background-color: var(--jp-layout-color2);\n fill: var(--jp-ui-font-color0);\n color: var(--jp-ui-font-color0);\n}\n\n.jp-CollaboratorHeaderCollapser {\n transform: rotate(-90deg);\n margin: auto 0;\n height: 16px;\n}\n\n.jp-CollaboratorHeader:not(.jp-ClickableCollaborator) .jp-CollaboratorHeaderCollapser {\n visibility: hidden;\n}\n\n.jp-CollaboratorHeaderCollapser.jp-mod-expanded {\n transform: rotate(0deg);\n}\n\n.jp-CollaboratorIcon {\n border-radius: 100%;\n padding: 2px;\n width: 24px;\n height: 24px;\n display: flex;\n}\n\n.jp-CollaboratorIcon > span {\n text-align: center;\n margin: auto;\n font-size: 12px;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-CollaboratorFiles {\n padding-left: 1em;\n margin-top: 0;\n box-shadow: 0 2px 2px -2px rgb(0 0 0 / 24%);\n\n}\n",""]);const l=i},921:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-toolbar-users-item {\n flex-grow: 1;\n display: flex;\n flex-direction: row;\n}\n\n.jp-toolbar-users-item .jp-MenuBar-anonymousIcon,\n.jp-toolbar-users-item .jp-MenuBar-imageIcon {\n position: relative;\n left: 0;\n height: 22px;\n width: 22px;\n box-sizing: border-box;\n cursor: default;\n}\n",""]);const l=i},935:n=>{n.exports=function(n){var e=[];return e.toString=function(){return this.map((function(e){var o="",r=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),r&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=n(e),r&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(n,o,r,t,a){"string"==typeof n&&(n=[[null,n,void 0]]);var i={};if(r)for(var l=0;l<this.length;l++){var p=this[l][0];null!=p&&(i[p]=!0)}for(var s=0;s<n.length;s++){var c=[].concat(n[s]);r&&i[c[0]]||(void 0!==a&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),o&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=o):c[2]=o),t&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=t):c[4]="".concat(t)),e.push(c))}},e}},758:n=>{n.exports=function(n){return n[1]}},591:n=>{var e=[];function o(n){for(var o=-1,r=0;r<e.length;r++)if(e[r].identifier===n){o=r;break}return o}function r(n,r){for(var a={},i=[],l=0;l<n.length;l++){var p=n[l],s=r.base?p[0]+r.base:p[0],c=a[s]||0,u="".concat(s," ").concat(c);a[s]=c+1;var d=o(u),f={css:p[1],media:p[2],sourceMap:p[3],supports:p[4],layer:p[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var m=t(f,r);r.byIndex=l,e.splice(l,0,{identifier:u,updater:m,references:1})}i.push(u)}return i}function t(n,e){var o=e.domAPI(e);return o.update(n),function(e){if(e){if(e.css===n.css&&e.media===n.media&&e.sourceMap===n.sourceMap&&e.supports===n.supports&&e.layer===n.layer)return;o.update(n=e)}else o.remove()}}n.exports=function(n,t){var a=r(n=n||[],t=t||{});return function(n){n=n||[];for(var i=0;i<a.length;i++){var l=o(a[i]);e[l].references--}for(var p=r(n,t),s=0;s<a.length;s++){var c=o(a[s]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}a=p}}},128:n=>{var e={};n.exports=function(n,o){var r=function(n){if(void 0===e[n]){var o=document.querySelector(n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(n){o=null}e[n]=o}return e[n]}(n);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(o)}},51:n=>{n.exports=function(n){var e=document.createElement("style");return n.setAttributes(e,n.attributes),n.insert(e,n.options),e}},855:(n,e,o)=>{n.exports=function(n){var e=o.nc;e&&n.setAttribute("nonce",e)}},740:n=>{n.exports=function(n){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=n.insertStyleElement(n);return{update:function(o){!function(n,e,o){var r="";o.supports&&(r+="@supports (".concat(o.supports,") {")),o.media&&(r+="@media ".concat(o.media," {"));var t=void 0!==o.layer;t&&(r+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),r+=o.css,t&&(r+="}"),o.media&&(r+="}"),o.supports&&(r+="}");var a=o.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(r,n,e.options)}(e,n,o)},remove:function(){!function(n){if(null===n.parentNode)return!1;n.parentNode.removeChild(n)}(e)}}}},656:n=>{n.exports=function(n,e){if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},944:(n,e,o)=>{var r=o(591),t=o.n(r),a=o(740),i=o.n(a),l=o(128),p=o.n(l),s=o(855),c=o.n(s),u=o(51),d=o.n(u),f=o(656),m=o.n(f),v=o(78),h={};h.styleTagTransform=m(),h.setAttributes=c(),h.insert=p().bind(null,"head"),h.domAPI=i(),h.insertStyleElement=d(),t()(v.A,h),v.A&&v.A.locals&&v.A.locals}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _JUPYTERLAB;(()=>{"use strict";var e,r,t,o,n,a,i,l,u,s,d,f,p,c,v,h,b,y,m,g,j,w,P,S={496:(e,r,t)=>{var o={"./index":()=>Promise.all([t.e(738),t.e(189),t.e(703)]).then((()=>()=>t(703))),"./extension":()=>Promise.all([t.e(738),t.e(189),t.e(703)]).then((()=>()=>t(703))),"./style":()=>t.e(944).then((()=>()=>t(944)))},n=(e,r)=>(t.R=r,r=t.o(o,e)?o[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var o="default",n=t.S[o];if(n&&n!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[o]=e,t.I(o,r)}};t.d(r,{get:()=>n,init:()=>a})}},k={};function x(e){var r=k[e];if(void 0!==r)return r.exports;var t=k[e]={id:e,exports:{}};return S[e](t,t.exports,x),t.exports}x.m=S,x.c=k,x.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return x.d(r,{a:r}),r},x.d=(e,r)=>{for(var t in r)x.o(r,t)&&!x.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},x.f={},x.e=e=>Promise.all(Object.keys(x.f).reduce(((r,t)=>(x.f[t](e,r),r)),[])),x.u=e=>e+"."+{240:"cc74569552563e7ef963",444:"13de0fd44849e3f7d780",576:"21a3c1a9ebaebb58d346",703:"330942e5b860eabc4225",944:"a13dc96a22c557e2f32c"}[e]+".js?v="+{240:"cc74569552563e7ef963",444:"13de0fd44849e3f7d780",576:"21a3c1a9ebaebb58d346",703:"330942e5b860eabc4225",944:"a13dc96a22c557e2f32c"}[e],x.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),x.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@jupyter/docprovider-extension:",x.l=(t,o,n,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==n)for(var u=document.getElementsByTagName("script"),s=0;s<u.length;s++){var d=u[s];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==r+n){i=d;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,x.nc&&i.setAttribute("nonce",x.nc),i.setAttribute("data-webpack",r+n),i.src=t),e[t]=[o];var f=(r,o)=>{i.onerror=i.onload=null,clearTimeout(p);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach((e=>e(o))),r)return r(o)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),l&&document.head.appendChild(i)}},x.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{x.S={};var e={},r={};x.I=(t,o)=>{o||(o=[]);var n=r[t];if(n||(n=r[t]={}),!(o.indexOf(n)>=0)){if(o.push(n),e[t])return e[t];x.o(x.S,t)||(x.S[t]={});var a=x.S[t],i="@jupyter/docprovider-extension",l=(e,r,t,o)=>{var n=a[e]=a[e]||{},l=n[r];(!l||!l.loaded&&(!o!=!l.eager?o:i>l.from))&&(n[r]={get:t,from:i,eager:!!o})},u=[];return"default"===t&&(l("@jupyter/collaborative-drive","4.0.0",(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),l("@jupyter/docprovider-extension","4.0.0",(()=>Promise.all([x.e(738),x.e(189),x.e(703)]).then((()=>()=>x(703))))),l("@jupyter/docprovider","4.0.0",(()=>Promise.all([x.e(738),x.e(262),x.e(240)]).then((()=>()=>x(240))))),l("y-websocket","1.5.4",(()=>Promise.all([x.e(576),x.e(206)]).then((()=>()=>x(576)))))),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),(()=>{var e;x.g.importScripts&&(e=x.g.location+"");var r=x.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),x.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),o=t[1]?r(t[1]):[];return t[2]&&(o.length++,o.push.apply(o,r(t[2]))),t[3]&&(o.push([]),o.push.apply(o,r(t[3]))),o},o=(e,r)=>{e=t(e),r=t(r);for(var o=0;;){if(o>=e.length)return o<r.length&&"u"!=(typeof r[o])[0];var n=e[o],a=(typeof n)[0];if(o>=r.length)return"u"==a;var i=r[o],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"u"==a;if("o"!=a&&"u"!=a&&n!=i)return n<i;o++}},n=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var o=1,a=1;a<e.length;a++)o--,t+="u"==(typeof(l=e[a]))[0]?"-":(o>0?".":"")+(o=2,l);return t}var i=[];for(a=1;a<e.length;a++){var l=e[a];i.push(0===l?"not("+u()+")":1===l?"("+u()+" || "+u()+")":2===l?i.pop()+" "+i.pop():n(l))}return u();function u(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var o=e[0],n=o<0;n&&(o=-o-1);for(var i=0,l=1,u=!0;;l++,i++){var s,d,f=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(d=(typeof(s=r[i]))[0]))return!u||("u"==f?l>o&&!n:""==f!=n);if("u"==d){if(!u||"u"!=f)return!1}else if(u)if(f==d)if(l<=o){if(s!=e[l])return!1}else{if(n?s>e[l]:s<e[l])return!1;s!=e[l]&&(u=!1)}else if("s"!=f&&"n"!=f){if(n||l<=o)return!1;u=!1,l--}else{if(l<=o||d<f!=n)return!1;u=!1}else"s"!=f&&"n"!=f&&(u=!1,l--)}}var p=[],c=p.pop.bind(p);for(i=1;i<e.length;i++){var v=e[i];p.push(1==v?c()|c():2==v?c()&c():v?a(v,r):!c())}return!!c()},i=(e,r)=>e&&x.o(e,r),l=e=>(e.loaded=1,e.get()),u=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),s=(e,r,t,n)=>{var i=n?u(e[r]):e[r];return(r=Object.keys(i).reduce(((e,r)=>!a(t,r)||e&&!o(e,r)?e:r),0))&&i[r]},d=(e,r,t)=>{var n=t?u(e[r]):e[r];return Object.keys(n).reduce(((e,r)=>!e||!n[e].loaded&&o(e,r)?r:e),0)},f=(e,r,t,o)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+n(o)+")",p=(e,r,t,o,a)=>{var i=e[t];return"No satisfying version ("+n(o)+")"+(a?" for eager consumption":"")+" of shared module "+t+" found in shared scope "+r+".\nAvailable versions: "+Object.keys(i).map((e=>e+" from "+i[e].from)).join(", ")},c=e=>{throw new Error(e)},v=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},b=(e,r,t)=>t?t():((e,r)=>c("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),y=(h=e=>function(r,t,o,n,a){var i=x.I(r);return i&&i.then&&!o?i.then(e.bind(e,r,x.S[r],t,!1,n,a)):e(r,x.S[r],t,o,n,a)})(((e,r,t,o,n,a)=>{if(!i(r,t))return b(e,t,a);var u=s(r,t,n,o);return u?l(u):a?a():void c(p(r,e,t,n,o))})),m=h(((e,r,t,o,n,u)=>{if(!i(r,t))return b(e,t,u);var s=d(r,t,o);return a(n,s)||v(f(r,t,s,n)),l(r[t][s])})),g={},j={569:()=>m("default","@jupyterlab/apputils",!1,[1,4,5,0]),579:()=>m("default","@jupyterlab/translation",!1,[1,4,4,0]),808:()=>m("default","@jupyterlab/coreutils",!1,[1,6,4,0]),0:()=>m("default","@jupyter/ydoc",!1,[1,3,0,0,,"a3"]),191:()=>m("default","@jupyterlab/logconsole",!1,[1,4,4,0]),256:()=>m("default","@lumino/widgets",!1,[1,2,3,1,,"alpha",0]),319:()=>m("default","@jupyterlab/statusbar",!1,[1,4,4,0]),369:()=>m("default","@jupyterlab/notebook",!1,[1,4,4,0]),507:()=>m("default","@jupyterlab/settingregistry",!1,[1,4,4,0]),570:()=>m("default","@jupyter/docprovider",!1,[1,4,0,0],(()=>Promise.all([x.e(262),x.e(240)]).then((()=>()=>x(240))))),726:()=>m("default","@jupyter/collaborative-drive",!1,[1,4,0,0],(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),739:()=>m("default","@jupyterlab/fileeditor",!1,[1,4,4,0]),262:()=>m("default","@lumino/coreutils",!1,[1,2,0,0]),345:()=>m("default","react",!1,[1,18,2,0]),560:()=>y("default","y-websocket",!1,[1,1,3,15],(()=>Promise.all([x.e(576),x.e(206)]).then((()=>()=>x(576))))),602:()=>m("default","@lumino/signaling",!1,[1,2,0,0]),695:()=>m("default","@jupyterlab/services",!1,[1,7,4,0]),989:()=>m("default","@jupyterlab/ui-components",!1,[1,4,4,0]),206:()=>m("default","yjs",!1,[1,13,5,40])},w={189:[0,191,256,319,369,507,570,726,739],206:[206],240:[345,560,602,695,989],262:[262],738:[569,579,808]},P={},x.f.consumes=(e,r)=>{x.o(w,e)&&w[e].forEach((e=>{if(x.o(g,e))return r.push(g[e]);if(!P[e]){var t=r=>{g[e]=0,x.m[e]=t=>{delete x.c[e],t.exports=r()}};P[e]=!0;var o=r=>{delete g[e],x.m[e]=t=>{throw delete x.c[e],r}};try{var n=j[e]();n.then?r.push(g[e]=n.then(t).catch(o)):t(n)}catch(e){o(e)}}}))},(()=>{var e={552:0};x.f.j=(r,t)=>{var o=x.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else if(/^(189|206|262|738)$/.test(r))e[r]=0;else{var n=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=n);var a=x.p+x.u(r),i=new Error;x.l(a,(t=>{if(x.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+n+": "+a+")",i.name="ChunkLoadError",i.type=n,i.request=a,o[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,n,[a,i,l]=t,u=0;if(a.some((r=>0!==e[r]))){for(o in i)x.o(i,o)&&(x.m[o]=i[o]);l&&l(x)}for(r&&r(t);u<a.length;u++)n=a[u],x.o(e,n)&&e[n]&&e[n][0](),e[n]=0},t=self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),x.nc=void 0;var E=x(496);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["@jupyter/docprovider-extension"]=E})();
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
"packages": [
|
|
3
3
|
{
|
|
4
4
|
"name": "@jupyter/collaboration",
|
|
5
|
-
"versionInfo": "
|
|
5
|
+
"versionInfo": "4.0.0",
|
|
6
6
|
"licenseId": "BSD-3-Clause",
|
|
7
7
|
"extractedText": ""
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "@jupyter/collaborative-drive",
|
|
11
|
-
"versionInfo": "
|
|
11
|
+
"versionInfo": "4.0.0",
|
|
12
12
|
"licenseId": "BSD-3-Clause",
|
|
13
13
|
"extractedText": ""
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"name": "@jupyter/docprovider",
|
|
17
|
-
"versionInfo": "
|
|
17
|
+
"versionInfo": "4.0.0",
|
|
18
18
|
"licenseId": "BSD-3-Clause",
|
|
19
19
|
"extractedText": ""
|
|
20
20
|
},
|
{jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/package.json
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/docprovider",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "JupyterLab - Document Provider",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyter-collaboration",
|
|
6
6
|
"bugs": {
|
|
@@ -41,28 +41,28 @@
|
|
|
41
41
|
"watch": "tsc -b --watch"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@jupyter/collaborative-drive": "^
|
|
45
|
-
"@jupyter/ydoc": "^2.
|
|
46
|
-
"@jupyterlab/apputils": "^4.
|
|
47
|
-
"@jupyterlab/cells": "^4.
|
|
48
|
-
"@jupyterlab/coreutils": "^6.
|
|
49
|
-
"@jupyterlab/notebook": "^4.
|
|
50
|
-
"@jupyterlab/services": "^7.
|
|
51
|
-
"@jupyterlab/translation": "^4.
|
|
52
|
-
"@lumino/coreutils": "^2.1
|
|
53
|
-
"@lumino/disposable": "^2.1.
|
|
54
|
-
"@lumino/signaling": "^2.1.
|
|
55
|
-
"@lumino/widgets": "^2.
|
|
44
|
+
"@jupyter/collaborative-drive": "^4.0.0",
|
|
45
|
+
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
|
|
46
|
+
"@jupyterlab/apputils": "^4.4.0",
|
|
47
|
+
"@jupyterlab/cells": "^4.4.0",
|
|
48
|
+
"@jupyterlab/coreutils": "^6.4.0",
|
|
49
|
+
"@jupyterlab/notebook": "^4.4.0",
|
|
50
|
+
"@jupyterlab/services": "^7.4.0",
|
|
51
|
+
"@jupyterlab/translation": "^4.4.0",
|
|
52
|
+
"@lumino/coreutils": "^2.2.1",
|
|
53
|
+
"@lumino/disposable": "^2.1.4",
|
|
54
|
+
"@lumino/signaling": "^2.1.4",
|
|
55
|
+
"@lumino/widgets": "^2.7.0",
|
|
56
56
|
"y-protocols": "^1.0.5",
|
|
57
57
|
"y-websocket": "^1.3.15",
|
|
58
58
|
"yjs": "^13.5.40"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@jupyterlab/testing": "^4.
|
|
61
|
+
"@jupyterlab/testing": "^4.4.0",
|
|
62
62
|
"@types/jest": "^29.2.0",
|
|
63
63
|
"jest": "^29.5.0",
|
|
64
64
|
"rimraf": "^4.1.2",
|
|
65
|
-
"typescript": "~5.
|
|
65
|
+
"typescript": "~5.1.6"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { ICollaborativeContentProvider } from '@jupyter/collaborative-drive';
|
|
5
5
|
import {
|
|
6
6
|
ForkManager,
|
|
7
7
|
JUPYTER_COLLABORATION_FORK_EVENTS_URI
|
|
@@ -11,10 +11,9 @@ import { Signal } from '@lumino/signaling';
|
|
|
11
11
|
import { requestAPI } from '../requests';
|
|
12
12
|
jest.mock('../requests');
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
name: 'rtc',
|
|
14
|
+
const contentProviderMock = {
|
|
16
15
|
providers: new Map()
|
|
17
|
-
} as
|
|
16
|
+
} as ICollaborativeContentProvider;
|
|
18
17
|
const stream = new Signal({});
|
|
19
18
|
const eventManagerMock = {
|
|
20
19
|
stream: stream as any
|
|
@@ -24,7 +23,7 @@ describe('@jupyter/docprovider', () => {
|
|
|
24
23
|
let manager: ForkManager;
|
|
25
24
|
beforeEach(() => {
|
|
26
25
|
manager = new ForkManager({
|
|
27
|
-
|
|
26
|
+
contentProvider: contentProviderMock,
|
|
28
27
|
eventManager: eventManagerMock
|
|
29
28
|
});
|
|
30
29
|
});
|
{jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/forkManager.ts
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { ICollaborativeContentProvider } from '@jupyter/collaborative-drive';
|
|
7
7
|
import { URLExt } from '@jupyterlab/coreutils';
|
|
8
8
|
import { Event } from '@jupyterlab/services';
|
|
9
9
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
@@ -22,8 +22,8 @@ export const JUPYTER_COLLABORATION_FORK_EVENTS_URI =
|
|
|
22
22
|
|
|
23
23
|
export class ForkManager implements IForkManager {
|
|
24
24
|
constructor(options: ForkManager.IOptions) {
|
|
25
|
-
const {
|
|
26
|
-
this.
|
|
25
|
+
const { contentProvider, eventManager } = options;
|
|
26
|
+
this._contentProvider = contentProvider;
|
|
27
27
|
this._eventManager = eventManager;
|
|
28
28
|
this._eventManager.stream.connect(this._handleEvent, this);
|
|
29
29
|
}
|
|
@@ -81,14 +81,12 @@ export class ForkManager implements IForkManager {
|
|
|
81
81
|
type: string;
|
|
82
82
|
}): IForkProvider | undefined {
|
|
83
83
|
const { documentPath, format, type } = options;
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
const provider = drive.providers.get(`${format}:${type}:${docPath}`);
|
|
84
|
+
const contentProvider = this._contentProvider;
|
|
85
|
+
if (contentProvider) {
|
|
86
|
+
const docPath = documentPath;
|
|
87
|
+
const provider = contentProvider.providers.get(
|
|
88
|
+
`${format}:${type}:${docPath}`
|
|
89
|
+
);
|
|
92
90
|
return provider as IForkProvider | undefined;
|
|
93
91
|
}
|
|
94
92
|
return;
|
|
@@ -112,7 +110,7 @@ export class ForkManager implements IForkManager {
|
|
|
112
110
|
}
|
|
113
111
|
|
|
114
112
|
private _disposed = false;
|
|
115
|
-
private
|
|
113
|
+
private _contentProvider: ICollaborativeContentProvider | undefined;
|
|
116
114
|
private _eventManager: Event.IManager | undefined;
|
|
117
115
|
private _forkAddedSignal = new Signal<ForkManager, IForkChangedEvent>(this);
|
|
118
116
|
private _forkDeletedSignal = new Signal<ForkManager, IForkChangedEvent>(this);
|
|
@@ -120,7 +118,7 @@ export class ForkManager implements IForkManager {
|
|
|
120
118
|
|
|
121
119
|
export namespace ForkManager {
|
|
122
120
|
export interface IOptions {
|
|
123
|
-
|
|
121
|
+
contentProvider: ICollaborativeContentProvider;
|
|
124
122
|
eventManager: Event.IManager;
|
|
125
123
|
}
|
|
126
124
|
}
|
{jupyter_docprovider-1.1.0rc0 → jupyter_docprovider-2.0.0}/packages/docprovider/src/ydrive.ts
RENAMED
|
@@ -3,16 +3,22 @@
|
|
|
3
3
|
|
|
4
4
|
import { PageConfig, URLExt } from '@jupyterlab/coreutils';
|
|
5
5
|
import { TranslationBundle } from '@jupyterlab/translation';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Contents,
|
|
8
|
+
IContentProvider,
|
|
9
|
+
RestContentProvider,
|
|
10
|
+
SharedDocumentFactory,
|
|
11
|
+
ServerConnection,
|
|
12
|
+
User
|
|
13
|
+
} from '@jupyterlab/services';
|
|
7
14
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
8
15
|
|
|
9
16
|
import { DocumentChange, ISharedDocument, YDocument } from '@jupyter/ydoc';
|
|
10
17
|
|
|
11
18
|
import { WebSocketProvider } from './yprovider';
|
|
12
19
|
import {
|
|
13
|
-
|
|
14
|
-
ISharedModelFactory
|
|
15
|
-
SharedDocumentFactory
|
|
20
|
+
IDocumentProvider,
|
|
21
|
+
ISharedModelFactory
|
|
16
22
|
} from '@jupyter/collaborative-drive';
|
|
17
23
|
import { Awareness } from 'y-protocols/awareness';
|
|
18
24
|
|
|
@@ -31,55 +37,37 @@ export interface IForkProvider {
|
|
|
31
37
|
format: string;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
*
|
|
42
|
-
* @param user - The user manager to add the identity to the awareness of documents.
|
|
43
|
-
*/
|
|
44
|
-
constructor(
|
|
45
|
-
user: User.IManager,
|
|
46
|
-
translator: TranslationBundle,
|
|
47
|
-
globalAwareness: Awareness | null
|
|
48
|
-
) {
|
|
49
|
-
super({ name: 'RTC' });
|
|
50
|
-
this._user = user;
|
|
51
|
-
this._trans = translator;
|
|
52
|
-
this._globalAwareness = globalAwareness;
|
|
53
|
-
this._providers = new Map<string, WebSocketProvider>();
|
|
40
|
+
namespace RtcContentProvider {
|
|
41
|
+
export interface IOptions extends RestContentProvider.IOptions {
|
|
42
|
+
user: User.IManager;
|
|
43
|
+
trans: TranslationBundle;
|
|
44
|
+
globalAwareness: Awareness | null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
54
47
|
|
|
48
|
+
export class RtcContentProvider
|
|
49
|
+
extends RestContentProvider
|
|
50
|
+
implements IContentProvider
|
|
51
|
+
{
|
|
52
|
+
constructor(options: RtcContentProvider.IOptions) {
|
|
53
|
+
super(options);
|
|
54
|
+
this._user = options.user;
|
|
55
|
+
this._trans = options.trans;
|
|
56
|
+
this._globalAwareness = options.globalAwareness;
|
|
57
|
+
this._serverSettings = options.serverSettings;
|
|
55
58
|
this.sharedModelFactory = new SharedModelFactory(this._onCreate);
|
|
56
|
-
|
|
57
|
-
// pass through any events from the Drive superclass
|
|
58
|
-
this._ydriveFileChanged.emit(change);
|
|
59
|
-
});
|
|
59
|
+
this._providers = new Map<string, WebSocketProvider>();
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* SharedModel factory for the
|
|
63
|
+
* SharedModel factory for the content provider.
|
|
64
64
|
*/
|
|
65
65
|
readonly sharedModelFactory: ISharedModelFactory;
|
|
66
66
|
|
|
67
|
-
get providers(): Map<string,
|
|
67
|
+
get providers(): Map<string, IDocumentProvider> {
|
|
68
68
|
return this._providers;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
/**
|
|
72
|
-
* Dispose of the resources held by the manager.
|
|
73
|
-
*/
|
|
74
|
-
dispose(): void {
|
|
75
|
-
if (this.isDisposed) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
this._providers.forEach(p => p.dispose());
|
|
79
|
-
this._providers.clear();
|
|
80
|
-
super.dispose();
|
|
81
|
-
}
|
|
82
|
-
|
|
83
71
|
/**
|
|
84
72
|
* Get a file or directory.
|
|
85
73
|
*
|
|
@@ -88,8 +76,6 @@ export class YDrive extends Drive implements ICollaborativeDrive {
|
|
|
88
76
|
* @param options: The options used to fetch the file.
|
|
89
77
|
*
|
|
90
78
|
* @returns A promise which resolves with the file content.
|
|
91
|
-
*
|
|
92
|
-
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.
|
|
93
79
|
*/
|
|
94
80
|
async get(
|
|
95
81
|
localPath: string,
|
|
@@ -166,7 +152,7 @@ export class YDrive extends Drive implements ICollaborativeDrive {
|
|
|
166
152
|
}
|
|
167
153
|
try {
|
|
168
154
|
const provider = new WebSocketProvider({
|
|
169
|
-
url: URLExt.join(this.
|
|
155
|
+
url: URLExt.join(this._serverSettings.wsUrl, DOCUMENT_PROVIDER_URL),
|
|
170
156
|
path: options.path,
|
|
171
157
|
format: options.format,
|
|
172
158
|
contentType: options.contentType,
|
|
@@ -177,9 +163,9 @@ export class YDrive extends Drive implements ICollaborativeDrive {
|
|
|
177
163
|
|
|
178
164
|
// Add the document path in the list of opened ones for this user.
|
|
179
165
|
const state = this._globalAwareness?.getLocalState() || {};
|
|
180
|
-
const documents:
|
|
166
|
+
const documents: string[] = state.documents || [];
|
|
181
167
|
if (!documents.includes(options.path)) {
|
|
182
|
-
documents.push(
|
|
168
|
+
documents.push(options.path);
|
|
183
169
|
this._globalAwareness?.setLocalStateField('documents', documents);
|
|
184
170
|
}
|
|
185
171
|
|
|
@@ -228,7 +214,7 @@ export class YDrive extends Drive implements ICollaborativeDrive {
|
|
|
228
214
|
// Remove the document path from the list of opened ones for this user.
|
|
229
215
|
const state = this._globalAwareness?.getLocalState() || {};
|
|
230
216
|
const documents: any[] = state.documents || [];
|
|
231
|
-
const index = documents.indexOf(
|
|
217
|
+
const index = documents.indexOf(options.path);
|
|
232
218
|
if (index > -1) {
|
|
233
219
|
documents.splice(index, 1);
|
|
234
220
|
}
|
|
@@ -245,9 +231,10 @@ export class YDrive extends Drive implements ICollaborativeDrive {
|
|
|
245
231
|
|
|
246
232
|
private _user: User.IManager;
|
|
247
233
|
private _trans: TranslationBundle;
|
|
248
|
-
private _providers: Map<string, WebSocketProvider>;
|
|
249
234
|
private _globalAwareness: Awareness | null;
|
|
235
|
+
private _providers: Map<string, WebSocketProvider>;
|
|
250
236
|
private _ydriveFileChanged = new Signal<this, Contents.IChangedArgs>(this);
|
|
237
|
+
private _serverSettings: ServerConnection.ISettings;
|
|
251
238
|
}
|
|
252
239
|
|
|
253
240
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/docprovider-extension",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "JupyterLab - Collaborative Shared Models",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,29 +53,29 @@
|
|
|
53
53
|
"watch:labextension": "jupyter labextension watch ."
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jupyter/collaborative-drive": "^
|
|
57
|
-
"@jupyter/docprovider": "^
|
|
58
|
-
"@jupyter/ydoc": "^2.
|
|
59
|
-
"@jupyterlab/application": "^4.
|
|
60
|
-
"@jupyterlab/apputils": "^4.
|
|
61
|
-
"@jupyterlab/docregistry": "^4.
|
|
62
|
-
"@jupyterlab/filebrowser": "^4.
|
|
63
|
-
"@jupyterlab/fileeditor": "^4.
|
|
64
|
-
"@jupyterlab/logconsole": "^4.
|
|
65
|
-
"@jupyterlab/notebook": "^4.
|
|
66
|
-
"@jupyterlab/settingregistry": "^4.
|
|
67
|
-
"@jupyterlab/translation": "^4.
|
|
68
|
-
"@lumino/commands": "^2.
|
|
56
|
+
"@jupyter/collaborative-drive": "^4.0.0",
|
|
57
|
+
"@jupyter/docprovider": "^4.0.0",
|
|
58
|
+
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
|
|
59
|
+
"@jupyterlab/application": "^4.4.0",
|
|
60
|
+
"@jupyterlab/apputils": "^4.4.0",
|
|
61
|
+
"@jupyterlab/docregistry": "^4.4.0",
|
|
62
|
+
"@jupyterlab/filebrowser": "^4.4.0",
|
|
63
|
+
"@jupyterlab/fileeditor": "^4.4.0",
|
|
64
|
+
"@jupyterlab/logconsole": "^4.4.0",
|
|
65
|
+
"@jupyterlab/notebook": "^4.4.0",
|
|
66
|
+
"@jupyterlab/settingregistry": "^4.4.0",
|
|
67
|
+
"@jupyterlab/translation": "^4.4.0",
|
|
68
|
+
"@lumino/commands": "^2.3.2",
|
|
69
69
|
"y-protocols": "^1.0.5",
|
|
70
70
|
"y-websocket": "^1.3.15",
|
|
71
71
|
"yjs": "^13.5.40"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@jupyterlab/builder": "^4.
|
|
74
|
+
"@jupyterlab/builder": "^4.4.0",
|
|
75
75
|
"@types/react": "~18.3.1",
|
|
76
76
|
"npm-run-all": "^4.1.5",
|
|
77
77
|
"rimraf": "^4.1.2",
|
|
78
|
-
"typescript": "~5.
|
|
78
|
+
"typescript": "~5.1.6"
|
|
79
79
|
},
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|