jupyter-collaboration-ui 2.1.1__tar.gz → 2.1.2__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_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/PKG-INFO +1 -1
- jupyter_collaboration_ui-2.1.2/jupyter_collaboration_ui/_version.py +1 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/package.json +5 -5
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/schemas/@jupyter/collaboration-extension/package.json.orig +4 -4
- jupyter_collaboration_ui-2.1.2/jupyter_collaboration_ui/labextension/static/240.61d3aa702c2fa861c087.js +1 -0
- jupyter_collaboration_ui-2.1.2/jupyter_collaboration_ui/labextension/static/393.f5e8288bb3ed18ac084a.js +1 -0
- jupyter_collaboration_ui-2.1.2/jupyter_collaboration_ui/labextension/static/842.6243a771ad51bd0bf3f3.js +1 -0
- jupyter_collaboration_ui-2.1.2/jupyter_collaboration_ui/labextension/static/remoteEntry.6a2662a819e4bd4f72ae.js +1 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/static/third-party-licenses.json +3 -3
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/package.json +1 -1
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/src/sharedlink.ts +4 -5
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration-extension/package.json +4 -4
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaborative-drive/package.json +1 -1
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaborative-drive/src/tokens.ts +6 -2
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/package.json +2 -2
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/ydrive.ts +110 -7
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider-extension/package.json +3 -3
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider-extension/src/filebrowser.ts +2 -1
- jupyter_collaboration_ui-2.1.1/jupyter_collaboration_ui/_version.py +0 -1
- jupyter_collaboration_ui-2.1.1/jupyter_collaboration_ui/labextension/static/240.d74f5ebc87b54f36fd16.js +0 -1
- jupyter_collaboration_ui-2.1.1/jupyter_collaboration_ui/labextension/static/393.5888b34eeb8b3edd043e.js +0 -1
- jupyter_collaboration_ui-2.1.1/jupyter_collaboration_ui/labextension/static/842.9e0e516fb674a459fa5b.js +0 -1
- jupyter_collaboration_ui-2.1.1/jupyter_collaboration_ui/labextension/static/remoteEntry.c80745f222a9092b29b8.js +0 -1
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/.gitignore +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/LICENSE +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/README.md +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/install.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/__init__.py +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/schemas/@jupyter/collaboration-extension/shared-link.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/schemas/@jupyter/collaboration-extension/user-menu-bar.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/static/422.c33fd4bf2f8b13b1f430.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/static/444.d6f3cc1c6d4b374efa63.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/static/784.586f70cab201cb43c954.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/static/944.27191c0195c19b79d6b0.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/static/952.8934cdeb03f9bd1e666f.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/jupyter_collaboration_ui/labextension/static/style.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/README.md +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/src/collaboratorspanel.tsx +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/src/components.tsx +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/src/cursors.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/src/index.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/src/menu.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/src/tokens.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/src/userinfopanel.tsx +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/src/users-item.tsx +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/style/base.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/style/index.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/style/index.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/style/menu.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/style/sharedlink.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/style/sidepanel.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/style/users-item.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/tsconfig.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration-extension/README.md +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration-extension/schema/shared-link.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration-extension/schema/user-menu-bar.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration-extension/src/collaboration.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration-extension/src/index.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration-extension/src/sharedlink.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration-extension/style/index.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration-extension/style/index.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration-extension/tsconfig.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaborative-drive/src/index.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaborative-drive/tsconfig.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/babel.config.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/jest.config.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/TimelineSlider.tsx +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/__tests__/forkManager.spec.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/__tests__/yprovider.spec.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/awareness.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/component.tsx +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/forkManager.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/index.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/notebookCellExecutor.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/requests.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/tokens.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/yprovider.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/style/base.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/style/index.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/style/index.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/style/slider.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/tsconfig.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/tsconfig.test.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider-extension/README.md +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider-extension/src/executor.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider-extension/src/forkManager.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider-extension/src/index.ts +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider-extension/style/index.css +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider-extension/style/index.js +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider-extension/tsconfig.json +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/pyproject.toml +0 -0
- {jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jupyter-collaboration-ui
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.2
|
|
4
4
|
Summary: JupyterLab/Jupyter Notebook 7+ extension providing user interface integration for real time collaboration
|
|
5
5
|
Project-URL: Documentation, https://jupyterlab-realtime-collaboration.readthedocs.io/
|
|
6
6
|
Project-URL: Repository, https://github.com/jupyterlab/jupyter-collaboration
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/collaboration-extension",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "JupyterLab - Real-Time Collaboration Extension",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"watch:labextension": "jupyter labextension watch ."
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jupyter/collaboration": "^4.1.
|
|
57
|
-
"@jupyter/collaborative-drive": "^4.1.
|
|
58
|
-
"@jupyter/docprovider": "^4.1.
|
|
56
|
+
"@jupyter/collaboration": "^4.1.2",
|
|
57
|
+
"@jupyter/collaborative-drive": "^4.1.2",
|
|
58
|
+
"@jupyter/docprovider": "^4.1.2",
|
|
59
59
|
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
|
|
60
60
|
"@jupyterlab/application": "^4.4.0",
|
|
61
61
|
"@jupyterlab/apputils": "^4.4.0",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
"_build": {
|
|
128
|
-
"load": "static/remoteEntry.
|
|
128
|
+
"load": "static/remoteEntry.6a2662a819e4bd4f72ae.js",
|
|
129
129
|
"extension": "./extension",
|
|
130
130
|
"style": "./style"
|
|
131
131
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/collaboration-extension",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "JupyterLab - Real-Time Collaboration Extension",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"watch:labextension": "jupyter labextension watch ."
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jupyter/collaboration": "^4.1.
|
|
57
|
-
"@jupyter/collaborative-drive": "^4.1.
|
|
58
|
-
"@jupyter/docprovider": "^4.1.
|
|
56
|
+
"@jupyter/collaboration": "^4.1.2",
|
|
57
|
+
"@jupyter/collaborative-drive": "^4.1.2",
|
|
58
|
+
"@jupyter/docprovider": "^4.1.2",
|
|
59
59
|
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
|
|
60
60
|
"@jupyterlab/application": "^4.4.0",
|
|
61
61
|
"@jupyterlab/apputils": "^4.4.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[240],{5068:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),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}},6758:e=>{e.exports=function(e){return e[1]}},2591: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,u="".concat(l," ").concat(d);s[l]=d+1;var h=n(u),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var v=r(p,o);o.byIndex=a,t.splice(a,0,{identifier:u,updater:v,references:1})}i.push(u)}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}}},8128: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)}},3051: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)}},1740: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)}}}},3656: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))}}},6240:(e,t,n)=>{n.r(t),n.d(t,{ForkManager:()=>z,IForkManagerToken:()=>q,JUPYTER_COLLABORATION_FORK_EVENTS_URI:()=>K,NotebookCellServerExecutor:()=>l,ROOM_FORK_URL:()=>p,RtcContentProvider:()=>C,TimelineWidget:()=>V,WebSocketAwarenessProvider:()=>r,WebSocketProvider:()=>w,requestAPI:()=>v,requestDocSession:()=>m,requestDocumentTimeline:()=>f,requestUndoRedo:()=>g});var o=n(3560);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(2986),i=n(1297),a=n(6860),c=n(9424);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:u}){var h,p,v;const m=(u=null!=u?u: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:m.__("Kernel Terminating"),body:m.__("The kernel for %1 appears to be terminating. You can not run any cell for now.",null===(h=l.session)||void 0===h?void 0:h.path),buttons:[s.Dialog.okButton()]});break}if(l.pendingInput)return await(0,s.showDialog)({title:m.__("Cell not executed due to pending input"),body:m.__("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===(v=null===(p=null==l?void 0:l.session)||void 0===p?void 0:p.kernel)||void 0===v?void 0:v.id,c=i.URLExt.join(this._serverSettings.baseUrl,`api/kernels/${n}/execute`),u=e.model.sharedModel.getId(),f=t.sharedModel.getState("document_id"),g={method:"POST",body:JSON.stringify({cell_id:u,document_id:f})};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",u="api/collaboration/undo_redo",h="api/collaboration/timeline",p="api/collaboration/fork";async function v(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 m(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 f(e,t,n){const o=a.ServerConnection.makeSettings();let r=i.URLExt.join(o.baseUrl,h,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,u,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(7262),_=n(4602);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 y.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(),_.Signal.clearData(this))}async reconnect(){this._disconnect(),this._connect()}async _connect(){const e=await m(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)}}var S=n(3721),b=n(6214);const k="true"===i.PageConfig.getOption("disableRTC");class C extends a.RestContentProvider{constructor(e){super(e),this._onCreate=(e,t)=>{var n,o,r,s,a,c,l;if("string"!=typeof e.format)return;const d=null===(r=null===(o=null===(n=this._docmanagerSettings)||void 0===n?void 0:n.composite)||void 0===o?void 0:o.autosave)||void 0===r||r;t.awareness.setLocalStateField("autosave",d),null===(s=this._docmanagerSettings)||void 0===s||s.changed.connect((()=>{var e,n,o;const r=null===(o=null===(n=null===(e=this._docmanagerSettings)||void 0===e?void 0:e.composite)||void 0===n?void 0:n.autosave)||void 0===o||o;t.awareness.setLocalStateField("autosave",r)}));try{const n=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}),o=((null===(a=this._globalAwareness)||void 0===a?void 0:a.getLocalState())||{}).documents||[];o.includes(e.path)||(o.push(e.path),null===(c=this._globalAwareness)||void 0===c||c.setLocalStateField("documents",o));let r=e.path,s=`${e.format}:${e.contentType}:${r}`;this._providers.set(s,n);const d=t=>{var n,o;const i=t.oldValue,a=t.newValue;if(!i||!a)return void console.debug("New or old path not given",t);const c=`${e.format}:${e.contentType}:${i}`;if(c!==s)return void console.error("The computed old provider key is different from the current key");const l=`${e.format}:${e.contentType}:${a}`,d=this._providers.get(c);if(!d)return void console.warn(`Could not find a provider to update after rename ${c}, ${l}`);this._providers.set(l,d),this._providers.delete(c),s=l,r=a;const u=((null===(n=this._globalAwareness)||void 0===n?void 0:n.getLocalState())||{}).documents||[],h=u.indexOf(i);u.includes(i)&&!u.includes(a)&&(u.splice(h,1),u.push(a),null===(o=this._globalAwareness)||void 0===o||o.setLocalStateField("documents",u))},u=(e,t)=>{var n,o;if("rename"!==t.type)return;const s=null===(n=t.oldValue)||void 0===n?void 0:n.path,i=null===(o=t.newValue)||void 0===o?void 0:o.path;s===r&&d({oldValue:s,newValue:i,name:"path"})};null===(l=this._driveFileChanged)||void 0===l||l.connect(u),t.changed.connect((async(n,o)=>{var r;if(!o.stateChange)return;const s=o.stateChange.filter((e=>"path"===e.name));for(const e of s)d(e);const i=o.stateChange.filter((e=>"hash"===e.name));if(0===i.length)return;i.length>1&&console.error("Unexpected multiple changes to hash value in a single transaction");const a=i[0],c=null!==(r=t.state.path)&&void 0!==r?r:e.path,l=await this.get(c,{content:!1});this._providerFileChanged.emit({type:"save",newValue:{...l,hash:a.newValue},oldValue:{hash:a.oldValue}})})),t.disposed.connect((()=>{var e,t,n;const o=this._providers.get(s);o&&(o.dispose(),this._providers.delete(s));const i=((null===(e=this._globalAwareness)||void 0===e?void 0:e.getLocalState())||{}).documents||[],a=i.indexOf(r);a>-1&&i.splice(a,1),null===(t=this._globalAwareness)||void 0===t||t.setLocalStateField("documents",i),null===(n=this._driveFileChanged)||void 0===n||n.disconnect(u)}))}catch(t){console.error(`Failed to open websocket connection for ${e.path}.\n:${t}`)}},this._saveCounter=0,this._providerFileChanged=new _.Signal(this),this._user=e.user,this._trans=e.trans,this._globalAwareness=e.globalAwareness,this._serverSettings=e.serverSettings,this.sharedModelFactory=new T(this._onCreate),this._providers=new Map,this._docmanagerSettings=e.docmanagerSettings,this._driveFileChanged=e.fileChanged}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={}){var n;if(t.format&&t.type){const o=`${t.format}:${t.type}:${e}`,r=this._providers.get(o),s=++this._saveCounter;if(r){const o=null===(n=r.wsProvider)||void 0===n?void 0:n.ws;if(o){const e=new y.PromiseDelegate,t=t=>{const n=new Uint8Array(t.data),o=S.$C(n);try{if(2!==S.cw(o))return}catch(e){return}const r=S.t3(o);let i=null;try{i=JSON.parse(r)}catch(e){console.debug("The raw reply received was not a JSON reply")}i&&"save"===i.type&&i.responseTo===s&&("success"===i.status?e.resolve():"failed"===i.status?e.reject("Saving failed"):"skipped"===i.status?e.reject("Saving already in progress"):e.reject("Unrecognised save reply status"))};o.addEventListener("message",t);const n=b.xv();b.zd(n,2),b.Qj(n,"save"),b.zd(n,s);const r=b.Fo(n);o.send(r),await e.promise,o.removeEventListener("message",t)}const i={type:t.type,format:t.format,content:!1};return this.get(e,i)}console.warn(`Could not find a provider for ${e}, falling back to REST API save`)}return super.save(e,t)}get fileChanged(){return this._providerFileChanged}}class T{constructor(e){this._onCreate=e,this.collaborative=!k,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 E=n(3345),x=n.n(E),R=n(2591),U=n.n(R),$=n(1740),P=n.n($),D=n(8128),j=n.n(D),N=n(855),L=n.n(N),F=n(3051),I=n.n(F),M=n(3656),A=n.n(M),O=n(5068),W={};W.styleTagTransform=A(),W.setAttributes=L(),W.insert=j().bind(null,"head"),W.domAPI=P(),W.insertStyleElement=I(),U()(O.A,W),O.A&&O.A.locals&&O.A.locals;var J=n(9694);const B=({apiURL:e,provider:t,contentType:n,format:o,documentTimelineUrl:r})=>{const[i,a]=(0,E.useState)({roomId:"",timestamps:[],forkRoom:"",sessionId:""}),[c,l]=(0,E.useState)(i.timestamps.length-1),[d,u]=(0,E.useState)(!1),[h,p]=(0,E.useState)(!1),v=(0,E.useRef)(!0),y=(0,E.useRef)(!0),_=(0,E.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 x().createElement("div",{className:"jp-sliderContainer"},x().createElement("div",{onClick:()=>{!async function(r){try{if(v.current){const i=await f(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 m(o,n,w(e))),u(!0),v.current=!1,d}}catch(e){console.error("Error fetching data:",e)}}(w(e))},className:"jp-mod-highlighted",title:"Document Timeline"},x().createElement(J.historyIcon.react,{marginRight:"4px"})),d&&x().createElement("div",{className:"jp-timestampDisplay"},x().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"}),x().createElement("div",null,x().createElement("strong",null,w(e).split("/").pop()," ")," "),h&&x().createElement("div",{className:"jp-restoreBtnContainer"},x().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(),u(!1),v.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 V 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 E.createElement(B,{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 q=new y.Token("@jupyter/docprovider:IForkManagerToken"),K="https://schema.jupyter.org/jupyter_collaboration/fork/v1";class z{constructor(e){this._disposed=!1,this._forkAddedSignal=new _.Signal(this),this._forkDeletedSignal=new _.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 v(a,s)}async getAllForks(e){const t=i.URLExt.join(p,e);return await v(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 v(`${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===K)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_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[393],{6393:(e,t,s)=>{s.r(t),s.d(t,{Collaborator:()=>C,CollaboratorsBody:()=>b,CollaboratorsPanel:()=>y,DefaultIconRenderer:()=>G,IUserMenu:()=>r,RendererUserMenu:()=>P,UserInfoBody:()=>V,UserInfoPanel:()=>z,UserMenu:()=>N,UsersItem:()=>q,remoteUserCursors:()=>U,showSharedLinkDialog:()=>B});var n=s(7262);const r=new n.Token("@jupyter/collaboration:IUserMenu");var a=s(2986),i=s(9694),o=s(4602),l=s(5256),c=s(3345),d=s.n(c);const h="jp-CollaboratorsList",u="jp-Collaborator",p="jp-CollaboratorHeader",_="jp-CollaboratorHeaderCollapser",m="jp-ClickableCollaborator",v="jp-CollaboratorIcon",g="jp-CollaboratorFiles",f="jp-CollaboratorFile";class y extends l.Panel{constructor(e,t,s,n){super({}),this._onAwarenessChanged=()=>{const e=this._awareness.getStates(),t=new Map;e.forEach(((e,s)=>{if(this._currentUser.isReady&&e.user&&e.user.username!==this._currentUser.identity.username){const s=`${e.user.username}-${e.current||"no-current"}`;t.has(s)||t.set(s,e)}})),this._collaboratorsChanged.emit(Array.from(t.values()))},this._collaboratorsChanged=new o.Signal(this),this._awareness=t,this._currentUser=e,this.addClass("jp-CollaboratorsPanel"),this.addWidget(a.ReactWidget.create(d().createElement(b,{fileopener:s,collaboratorsChanged:this._collaboratorsChanged,docRegistry:n}))),this._awareness.on("change",this._onAwarenessChanged)}}function b(e){const[t,s]=(0,c.useState)([]);return e.collaboratorsChanged.connect(((e,t)=>{s(t)})),d().createElement("div",{className:h},t.map((t=>{const s=`${t.user.username}-${t.current||"no-current"}`;return d().createElement(C,{key:s,collaborator:t,fileopener:e.fileopener,docRegistry:e.docRegistry})})))}function C(e){const[t,s]=(0,c.useState)(!1),{collaborator:n,fileopener:r}=e;let a="";if(n.current){const e=n.current.split(":");a=`${e[1]}`}const o=n.documents||[],l=o.map((t=>{var s,n;const r=null===(n=null===(s=e.docRegistry)||void 0===s?void 0:s.getFileTypesForPath(t))||void 0===n?void 0:n.filter((e=>void 0!==e.icon)),a=(null==r?void 0:r.length)?r[0].icon:i.fileIcon,o=(null==r?void 0:r.length)?r[0].iconClass:void 0;return{filename:t.length>40?t.slice(0,10).concat("…").concat(t.slice(t.length-15)):t,fileLocation:t,icon:a,iconClass:o}}));return d().createElement("div",{className:u},d().createElement("div",{className:l.length?`${m} ${p}`:p,onClick:o?()=>{l.length&&s(!t)}:void 0},d().createElement(i.LabIcon.resolveReact,{icon:i.caretDownIcon,className:_+(t?" jp-mod-expanded":""),tag:"div"}),d().createElement("div",{className:v,style:{backgroundColor:n.user.color}},d().createElement("span",null,n.user.initials)),d().createElement("span",null,n.user.display_name)),d().createElement("div",{className:`${g} jp-DirListing`,style:t?{}:{display:"none"}},d().createElement("ul",{className:"jp-DirListing-content"},l.map((e=>d().createElement("li",{className:"jp-DirListing-item "+(e.fileLocation===a?`${f} jp-mod-running`:f),key:e.filename,onClick:()=>r(e.fileLocation)},d().createElement(i.LabIcon.resolveReact,{icon:e.icon,iconClass:e.iconClass,tag:"span",className:"jp-DirListing-itemIcon",stylesheet:"listing"}),d().createElement("span",{className:"jp-DirListing-itemText",title:e.fileLocation},e.filename)))))))}var w=s(195),k=s(5024),j=s(2206);const S=w.Facet.define({combine:e=>e[e.length-1]}),E=k.EditorView.baseTheme({".jp-remote-cursor":{borderLeft:"1px solid black",marginLeft:"-1px"},".jp-remote-cursor.jp-mod-primary":{borderLeftWidth:"2px"},".jp-remote-selection":{opacity:.5},".cm-tooltip":{border:"none"},".cm-tooltip .jp-remote-userInfo":{color:"var(--jp-ui-inverse-font-color0)",padding:"0px 2px"}}),x=w.Annotation.define();class L{constructor(e,t){this.style=e,this.marker=t}draw(){const e=this.marker.draw();for(const[t,s]of Object.entries(this.style))e.style[t]=s;return e}eq(e){return this.marker.eq(e.marker)&&n.JSONExt.deepEqual(this.style,e.style)}update(e,t){for(const[t,s]of Object.entries(this.style))e.style[t]=s;return this.marker.update(e,t.marker)}}const A=(0,k.layer)({above:!0,markers(e){const{awareness:t,ytext:s}=e.state.facet(S),n=s.doc,r=[];return t.getStates().forEach(((a,i)=>{var o,l,c;if(i===t.doc.clientID)return;const d=a.cursors;for(const t of null!=d?d:[]){if(!(null==t?void 0:t.anchor)||!(null==t?void 0:t.head))return;const i=(0,j.createAbsolutePositionFromRelativePosition)(t.anchor,n),d=(0,j.createAbsolutePositionFromRelativePosition)(t.head,n);if((null==i?void 0:i.type)!==s||(null==d?void 0:d.type)!==s)return;const h=null===(o=t.primary)||void 0===o||o?"jp-remote-cursor jp-mod-primary":"jp-remote-cursor",u=w.EditorSelection.cursor(d.index,d.index>i.index?-1:1);for(const t of k.RectangleMarker.forRange(e,h,u))r.push(new L({borderLeftColor:null!==(c=null===(l=a.user)||void 0===l?void 0:l.color)&&void 0!==c?c:"black"},t))}})),r},update:(e,t)=>!!e.transactions.find((e=>e.annotation(x))),class:"jp-remote-cursors"}),I=(0,k.hoverTooltip)(((e,t)=>{var s;const{awareness:n,ytext:r}=e.state.facet(S),a=r.doc;for(const[e,i]of n.getStates())if(e!==n.doc.clientID)for(const e of null!==(s=i.cursors)&&void 0!==s?s:[]){if(!(null==e?void 0:e.head))continue;const s=(0,j.createAbsolutePositionFromRelativePosition)(e.head,a);if((null==s?void 0:s.type)===r&&s.index-3<=t&&t<=s.index+3)return{pos:s.index,above:!0,create:()=>{var e,t,s,n;const r=document.createElement("div");return r.classList.add("jp-remote-userInfo"),r.style.backgroundColor=null!==(t=null===(e=i.user)||void 0===e?void 0:e.color)&&void 0!==t?t:"darkgrey",r.textContent=null!==(n=null===(s=i.user)||void 0===s?void 0:s.display_name)&&void 0!==n?n:"Anonymous",{dom:r}}}}return null}),{hideOn:(e,t)=>!!e.annotation(x),hoverTime:0}),M=(0,k.layer)({above:!1,markers(e){const{awareness:t,ytext:s}=e.state.facet(S),n=s.doc,r=[];return t.getStates().forEach(((a,i)=>{var o,l,c;if(i===t.doc.clientID)return;const d=a.cursors;for(const t of null!=d?d:[]){if(null===(o=t.empty)||void 0===o||o||!(null==t?void 0:t.anchor)||!(null==t?void 0:t.head))return;const i=(0,j.createAbsolutePositionFromRelativePosition)(t.anchor,n),d=(0,j.createAbsolutePositionFromRelativePosition)(t.head,n);if((null==i?void 0:i.type)!==s||(null==d?void 0:d.type)!==s)return;const h="jp-remote-selection";for(const t of k.RectangleMarker.forRange(e,h,w.EditorSelection.range(i.index,d.index)))r.push(new L({backgroundColor:null!==(c=null===(l=a.user)||void 0===l?void 0:l.color)&&void 0!==c?c:"black"},t))}})),r},update:(e,t)=>!!e.transactions.find((e=>e.annotation(x))),class:"jp-remote-selections"}),R=k.ViewPlugin.fromClass(class{constructor(e){this.editorAwareness=e.state.facet(S),this._listener=({added:t,updated:s,removed:n})=>{t.concat(s).concat(n).findIndex((e=>e!==this.editorAwareness.awareness.doc.clientID))>=0&&e.dispatch({annotations:[x.of([])]})},this.editorAwareness.awareness.on("change",this._listener)}destroy(){this.editorAwareness.awareness.off("change",this._listener)}update(e){var t;if(!e.docChanged&&!e.selectionSet)return;const{awareness:s,ytext:r}=this.editorAwareness,a=s.getLocalState();if(a){const i=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),o=e.state.selection,l=new Array;if(i&&o){for(const e of o.ranges){const t=e===o.main,s=(0,j.createRelativePositionFromTypeIndex)(r,e.anchor),n=(0,j.createRelativePositionFromTypeIndex)(r,e.head);l.push({anchor:s,head:n,primary:t,empty:e.empty})}if(!a.cursors||l.length>0){const e=null===(t=a.cursors)||void 0===t?void 0:t.map((e=>({...e,anchor:(null==e?void 0:e.anchor)?(0,j.createRelativePositionFromJSON)(e.anchor):null,head:(null==e?void 0:e.head)?(0,j.createRelativePositionFromJSON)(e.head):null})));n.JSONExt.deepEqual(l,e)||s.setLocalStateField("cursors",l)}}}}},{provide:()=>[E,A,M,I,(0,k.tooltips)({position:"absolute",parent:document.body})]});function U(e){return[S.of(e),R]}var D=s(4873);class P extends l.MenuBar.Renderer{constructor(e){super(),this._user=e}renderItem(e){const t=this.createItemClass(e),s=this.createItemDataset(e),n=this.createItemARIA(e);return D.h.li({className:t,dataset:s,tabindex:"0",onfocus:e.onfocus,...n},this._createUserIcon(),this.renderLabel(e),this.renderIcon(e))}renderLabel(e){const t=this.formatLabel(e);return D.h.div({className:"lm-MenuBar-itemLabel jp-MenuBar-label"},t)}_createUserIcon(){return this._user.isReady&&this._user.identity.avatar_url?D.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-imageIcon"},D.h.img({src:this._user.identity.avatar_url})):this._user.isReady?D.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-anonymousIcon",style:{backgroundColor:this._user.identity.color}},D.h.span({},this._user.identity.initials)):D.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-anonymousIcon"},i.userIcon)}}class N extends l.Menu{constructor(e){super(e)}}var T=s(1297),O=s(9424);async function B({translator:e}){const t=(null!=e?e:O.nullTranslator).load("jupyter_collaboration"),s=T.PageConfig.getToken(),n=new URL(T.URLExt.normalize(T.PageConfig.getUrl({workspace:T.PageConfig.defaultWorkspace})));let r=!1,i=!1,o=!1,l=!1,c="",d="",h="";if(""!==T.PageConfig.getOption("hubUser")){h=T.PageConfig.getOption("hubServerUser"),d=T.PageConfig.getOption("hubServerName"),c=`${T.PageConfig.getOption("hubHost")||""}${T.PageConfig.getOption("hubPrefix")}api`;const e=await fetch(c,{headers:{Authorization:`token ${s}`}}),t=(await e.json()).version,[n]=t.split(".").map(Number);if(n>=5){const e=await fetch(`${c}/user`,{headers:{Authorization:`token ${s}`}}),t=await e.json();t.scopes.includes("read:users:name")&&(h===T.PageConfig.getOption("hubUser")&&t.scopes.includes("shares!user")||t.scopes.includes("shares!user="+h)||t.scopes.includes("shares!server="+h+"/"+d))&&(r=!0,(t.scopes.includes("list:users")||t.scopes.includes("read:users")||t.scopes.includes("admin:users"))&&(i=!0),(t.scopes.includes("list:groups")||t.scopes.includes("read:groups")||t.scopes.includes("admin:groups"))&&(o=!0),(h===T.PageConfig.getOption("hubUser")&&t.scopes.includes("servers!user")||t.scopes.includes("servers!user="+h)||t.scopes.includes("servers!server="+h+"/"+d+"/")||t.scopes.includes("admin:servers"))&&(l=!0))}}if(r){let e=d;return""===e&&(e="default"),(0,a.showDialog)({title:t.__("Share Jupyter Server %1",e),body:new $(n.toString(),d,i,o,l,h,c,s,t),buttons:[a.Dialog.cancelButton({label:t.__("Close"),caption:t.__("Close the dialog")}),a.Dialog.okButton({label:t.__("Copy Link"),caption:t.__("Copy the link to the Jupyter Server")})]})}return(0,a.showDialog)({title:t.__("Share Jupyter Server Link"),body:new F(n.toString(),s,""!==T.PageConfig.getOption("hubUser"),t),buttons:[a.Dialog.cancelButton(),a.Dialog.okButton({label:t.__("Copy Link"),caption:t.__("Copy the link to the Jupyter Server")})]})}class $ extends l.Widget{constructor(e,t,s,n,r,a,i,o,l){super(),this._url=e,this._serverName=t,this._canListUsers=s,this._canListGroups=n,this._canControlServer=r,this._serverOwner=a,this._hubApiUrl=i,this._token=o,this._trans=l,this._recipients=[],this._shares=[],this._searchInput=null,this._searchResults=null,this._sharesContainer=null,this._populateBody(this.node),this.addClass("jp-shared-link-body"),this._loadShares().then((()=>{this._updateSharesList().then((()=>{this._loadUsers()}))}))}getValue(){return this._url}onAfterAttach(e){super.onAfterAttach(e)}onBeforeDetach(e){super.onBeforeDetach(e)}async _loadUsers(){if(this._canListUsers){let e=0;const t=200;let s=[],n=!0;for(;n;){const r=await fetch(`${this._hubApiUrl}/users?limit=${t}&offset=${e}`,{headers:{Authorization:`token ${this._token}`}}),a=await r.json();s=s.concat(a),n=a.length===t,e+=t}const r=new Set(this._shares.filter((e=>"user"===e.type)).map((e=>e.name)));this._recipients=s.filter((e=>e.name!==this._serverOwner&&!r.has(e.name))).map((e=>({...e,type:"user"})))}if(this._canListGroups){const e=await fetch(`${this._hubApiUrl}/groups`,{headers:{Authorization:`token ${this._token}`}}),t=await e.json(),s=new Set(this._shares.filter((e=>"group"===e.type)).map((e=>e.name)));this._recipients=this._recipients.concat(t.filter((e=>!s.has(e.name))).map((e=>({name:e.name,type:"group"}))))}this._recipients.sort(((e,t)=>e.name.localeCompare(t.name))),this._updateSearchResults()}async _loadShares(){const e=await fetch(`${this._hubApiUrl}/shares/${this._serverOwner}/${this._serverName}`,{headers:{Authorization:`token ${this._token}`}}),t=await e.json();this._shares=t.items.map((e=>{var t,s;return{name:(null===(t=e.user)||void 0===t?void 0:t.name)||(null===(s=e.group)||void 0===s?void 0:s.name),createdAt:e.created_at,type:e.user?"user":"group"}}))}async _createShare(e,t){const s=["access:servers!server="+this._serverOwner+"/"+this._serverName];this._canControlServer&&s.push("servers!server="+this._serverOwner+"/"+this._serverName),await fetch(`${this._hubApiUrl}/shares/${this._serverOwner}/${this._serverName}`,{method:"POST",headers:{Authorization:`token ${this._token}`,"Content-Type":"application/json"},body:JSON.stringify({[t]:e.name,scopes:s})})}async _deleteShare(e,t){await fetch(`${this._hubApiUrl}/shares/${this._serverOwner}/${this._serverName}`,{method:"PATCH",headers:{Authorization:`token ${this._token}`},body:JSON.stringify({[t]:e.name})})}_populateBody(e){const t=document.createElement("div");t.classList.add("jp-ManageSharesBody-search-container"),this._searchInput=document.createElement("input"),this._searchInput.type="text",this._searchInput.classList.add("jp-ManageSharesBody-search-input"),this._searchInput.placeholder=this._trans.__("Type to search for a user or a group to share your server with..."),this._searchInput.addEventListener("input",(()=>{this._updateSearchResults()})),t.appendChild(this._searchInput),e.appendChild(t),this._searchResults=document.createElement("div"),this._searchResults.classList.add("jp-ManageSharesBody-search-results"),e.appendChild(this._searchResults),this._sharesContainer=document.createElement("div"),this._sharesContainer.classList.add("jp-ManageSharesBody-selected-users"),e.appendChild(this._sharesContainer);const s=document.createElement("input");s.classList.add("jp-ManageSharesBody-url-input"),s.readOnly=!0,s.value=this._url,e.appendChild(s),e.insertAdjacentHTML("beforeend","<br>"),e.insertAdjacentText("beforeend",this._trans.__("Warning: Anyone you share this server with will have access to all your files, not just the currently open file.")),e.insertAdjacentHTML("beforeend","<br>"),e.insertAdjacentText("beforeend",this._trans.__("If your Hub administrator allows it, you can create another server dedicated to sharing a specific project."))}_updateSearchResults(){var e;if(!this._searchResults)return;this._searchResults.innerHTML="";const t=(null===(e=this._searchInput)||void 0===e?void 0:e.value)||"";this._recipients.filter((e=>e.name.toLowerCase().includes(t.toLowerCase())||""===t)).forEach((e=>{var t;const s=document.createElement("div");s.classList.add("jp-ManageSharesBody-user-item"),"group"===e.type?s.textContent=this._trans.__("Group %1",e.name):s.textContent=e.name,s.addEventListener("click",(async()=>{await this._createShare(e,e.type),await this._loadShares(),await this._updateSharesList();const t=new Set(this._shares.map((e=>e.name)));this._recipients=this._recipients.filter((e=>e.name!==this._serverOwner&&!t.has(e.name))),this._updateSearchResults()})),null===(t=this._searchResults)||void 0===t||t.appendChild(s)}))}async _updateSharesList(){if(!this._sharesContainer)return;this._sharesContainer.innerHTML="";const e=document.createElement("table");e.classList.add("jp-ManageSharesBody-shares-table");const t=document.createElement("tr"),s=document.createElement("th");s.textContent=this._trans.__("Shared with");const n=document.createElement("th");n.textContent=this._trans.__("Shared since");const r=document.createElement("th");if(r.textContent=this._trans.__("Actions"),t.appendChild(s),t.appendChild(n),t.appendChild(r),e.appendChild(t),0===this._shares.length){const t=document.createElement("tr"),s=document.createElement("td");s.colSpan=3,s.textContent=this._trans.__("Your server is not shared to anybody yet. You can search for users and groups above."),t.appendChild(s),e.appendChild(t)}else this._shares.forEach((t=>{const s=document.createElement("tr"),n=document.createElement("td");"group"===t.type?n.textContent=this._trans.__("Group %1",t.name):n.textContent=t.name,s.appendChild(n);const r=document.createElement("td"),a=new Date(t.createdAt).toLocaleString([],{hour:"2-digit",minute:"2-digit",year:"numeric",month:"2-digit",day:"2-digit"});r.textContent=a,s.appendChild(r);const i=document.createElement("td"),o=document.createElement("button");o.textContent=this._trans.__("Revoke"),o.classList.add("jp-mod-styled"),o.addEventListener("click",(async()=>{await this._deleteShare(t,t.type),await this._loadShares(),await this._updateSharesList(),await this._loadUsers();const e=new Set(this._shares.map((e=>e.name)));this._recipients=this._recipients.filter((t=>t.name!==this._serverOwner&&!e.has(t.name))),this._updateSearchResults()})),i.appendChild(o),s.appendChild(i),e.appendChild(s)}));this._sharesContainer.appendChild(e)}}class F extends l.Widget{constructor(e,t,s,n){super(),this._url=e,this._token=t,this._behindHub=s,this._trans=n,this._tokenCheckbox=null,this._onTokenChange=e=>{const t=e.target;this._updateContent(null==t?void 0:t.checked)},this._warning=document.createElement("div"),this._populateBody(this.node),this.addClass("jp-shared-link-body")}getValue(){var e;if(!0===(null===(e=this._tokenCheckbox)||void 0===e?void 0:e.checked)){const e=new URL(this._url);return e.searchParams.set("token",this._token),e.toString()}return this._url}onAfterAttach(e){var t;super.onAfterAttach(e),null===(t=this._tokenCheckbox)||void 0===t||t.addEventListener("change",this._onTokenChange)}onBeforeDetach(e){var t;null===(t=this._tokenCheckbox)||void 0===t||t.removeEventListener("change",this._onTokenChange),super.onBeforeDetach(e)}_updateContent(e){this._warning.innerHTML="";const t=this.node.querySelector("input[readonly]");if(e){if(t){const e=new URL(this._url);e.searchParams.set("token",this._token.slice(0,5)),t.value=e.toString()+"…"}this._warning.appendChild(document.createElement("h3")).textContent=this._trans.__("Security warning!"),this._warning.insertAdjacentText("beforeend",this._trans.__("Anyone with this link has full access to your notebook server, including all your files!")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._warning.insertAdjacentText("beforeend",this._trans.__("Please be careful who you share it with.")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._behindHub?(this._warning.insertAdjacentText("beforeend",this._trans.__("They will be able to access this server AS YOU.")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._warning.insertAdjacentText("beforeend",this._trans.__("To revoke access, go to File -> Hub Control Panel, and restart your server."))):this._warning.insertAdjacentText("beforeend",this._trans.__("Currently, there is no way to revoke access other than shutting down your server."))}else t&&(t.value=this._url),this._behindHub?this._warning.insertAdjacentText("beforeend",this._trans.__("Only users with `access:servers` permissions for this server will be able to use this link.")):this._warning.insertAdjacentText("beforeend",this._trans.__("Only authenticated users will be able to use this link."))}_populateBody(e){const t=document.createElement("input");if(t.readOnly=!0,t.value=this._url,e.appendChild(t),this._token){const t=e.appendChild(document.createElement("label"));t.insertAdjacentHTML("beforeend",'<input type="checkbox">'),this._tokenCheckbox=t.firstChild,t.insertAdjacentText("beforeend",this._trans.__("Include token in URL")),e.insertAdjacentElement("beforeend",this._warning),this._updateContent(!1)}}}var H=s(6860);function W(e){const{userManager:t,onClick:s}=e,[n,r]=(0,c.useState)(t.identity);return(0,c.useEffect)((()=>{const e=()=>{r(t.identity)};return t.userChanged.connect(e),()=>{t.userChanged.disconnect(e)}}),[t]),d().createElement("div",{title:n.display_name,className:"jp-UserInfo-Icon",style:{backgroundColor:n.color},onClick:s},d().createElement("span",null,n.initials))}class J extends i.ReactWidget{constructor(e){super(),this._onChange=(e,t)=>{var s;const n=(null===(s=this._userManager.permissions)||void 0===s?void 0:s.updatable_fields)||[];(null==n?void 0:n.includes(t))&&(this._userUpdate[t]=e.target.value)},this._userUpdate={},this._userManager=e.userManager}getValue(){return this._userUpdate}render(){var e;const t=this._userManager.identity;if(!t)return d().createElement("div",{className:"jp-UserInfo-Details"},"Error loading user info");const s=(null===(e=this._userManager.permissions)||void 0===e?void 0:e.updatable_fields)||[];return d().createElement("div",{className:"jp-UserInfo-Details"},Object.keys(t).map((e=>{const n=`jp-UserInfo-Value-${e}`;return d().createElement("div",{key:e,className:"jp-UserInfo-Field"},d().createElement("label",{htmlFor:n},e),d().createElement("input",{type:"text",name:e,id:n,onInput:t=>this._onChange(t,e),defaultValue:t[e],disabled:!(null==s?void 0:s.includes(e))}))})))}}class z extends l.Panel{constructor(e){super({}),this.addClass("jp-UserInfoPanel"),this._profile=e.userManager,this._body=null,this._profile.isReady?(this._body=new V({userManager:this._profile,trans:e.trans}),this.addWidget(this._body),this.update()):this._profile.ready.then((()=>{this._body=new V({userManager:this._profile,trans:e.trans}),this.addWidget(this._body),this.update()})).catch((e=>console.error(e)))}}class V extends a.ReactWidget{constructor(e){super(),this.onClick=()=>{this._userManager.identity&&(0,a.showDialog)({body:new J({userManager:this._userManager}),title:this._trans.__("User Details")}).then((async e=>{if(e.button.accept)try{const t=H.ServerConnection.makeSettings(),s=T.URLExt.join(t.baseUrl,"/api/me"),n={method:"PATCH",body:JSON.stringify(e.value)};let r;try{r=await H.ServerConnection.makeRequest(s,n,t)}catch(e){throw new H.ServerConnection.NetworkError(e)}if(!r.ok){const e=this._trans.__("Failed to update user data");throw new Error(e)}this._userManager.refreshUser()}catch(e){console.error(e)}}))},this._userManager=e.userManager,this._trans=e.trans}get user(){return this._userManager}set user(e){this._userManager=e,this.update()}render(){return c.createElement("div",{className:"jp-UserInfo-Container"},c.createElement(W,{userManager:this._userManager,onClick:this.onClick}))}}class q extends c.Component{constructor(e){var t;super(e),this._awarenessChange=()=>{var e;const t=null===(e=this._model)||void 0===e?void 0:e.sharedModel.awareness.getStates(),s=[];t&&t.forEach(((e,t)=>{e.user&&s.push({userId:t,userData:e.user})})),this.setState((e=>({...e,usersList:s})))},this._model=e.model,this._iconRenderer=null!==(t=e.iconRenderer)&&void 0!==t?t:null,this.state={usersList:[]}}static createWidget(e){return i.ReactWidget.create(c.createElement(q,{...e}))}componentDidMount(){var e;null===(e=this._model)||void 0===e||e.sharedModel.awareness.on("change",this._awarenessChange),this._awarenessChange()}filterDuplicated(e){var t;const s=[],n=new Set;for(const r of e)(null===(t=null==r?void 0:r.userData)||void 0===t?void 0:t.username)&&!n.has(r.userData.username)&&(n.add(r.userData.username),s.push(r));return s}render(){var e;const t=null!==(e=this._iconRenderer)&&void 0!==e?e:G;return c.createElement("div",{className:"jp-toolbar-users-item"},this.filterDuplicated(this.state.usersList).map((e=>{if(this._model&&e.userId!==this._model.sharedModel.awareness.clientID)return t({user:e,model:this._model})})))}}function G(e){let t;const{user:s,model:n,...r}=e,a=(0,i.classes)("lm-MenuBar-itemIcon",e.className||"");return t=s.userData.avatar_url?c.createElement("div",{...r,key:s.userId,title:s.userData.display_name,className:(0,i.classes)(a,"jp-MenuBar-imageIcon")},c.createElement("img",{src:s.userData.avatar_url,alt:""})):c.createElement("div",{...r,key:s.userId,title:s.userData.display_name,className:(0,i.classes)(a,"jp-MenuBar-anonymousIcon"),style:{backgroundColor:s.userData.color}},c.createElement("span",null,s.userData.initials)),t}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[842],{4842:(e,r,a)=>{a.r(r),a.d(r,{default:()=>I});var o=a(2986),t=a(4337),n=a(6247),s=a(8963),i=a(9694),l=a(1297),c=a(6860),d=a(9404),u=a(9424),p=a(5256),m=a(1935),b=a(2206),y=a(7784);const w={id:"@jupyter/collaboration-extension:userMenu",description:"Provide connected user menu.",requires:[],provides:m.IUserMenu,activate:e=>{const{commands:r}=e,{user:a}=e.serviceManager;return new m.UserMenu({commands:r,user:a})}},v={id:"@jupyter/collaboration-extension:user-menu-bar",description:"Add user menu to the interface.",autoStart:!0,requires:[m.IUserMenu,o.IToolbarWidgetRegistry],activate:async(e,r,a)=>{const{user:o}=e.serviceManager,t=new p.MenuBar({forceItemsPosition:{forceX:!1,forceY:!1},renderer:new m.RendererUserMenu(o)});t.id="jp-UserMenu",o.userChanged.connect((()=>t.update())),t.addMenu(r),a.addFactory("TopBar","user-menu",(()=>t))}},g={id:"@jupyter/collaboration-extension:rtcGlobalAwareness",description:"Add global awareness to share working document of users.",requires:[d.IStateDB],provides:n.IGlobalAwareness,activate:(e,r)=>{const{user:a}=e.serviceManager,o=new b.Doc,t=new y.ww(o),n=c.ServerConnection.makeSettings(),i=l.URLExt.join(n.wsUrl,"api/collaboration/room");return new s.WebSocketAwarenessProvider({url:i,roomID:"JupyterLab:globalAwareness",awareness:t,user:a}),r.changed.connect((async()=>{var e,a;const o=(null===(a=null===(e=(await r.toJSON())["layout-restorer:data"])||void 0===e?void 0:e.main)||void 0===a?void 0:a.current)||"";o.match(/^\w+:.+/)?t.setLocalStateField("current",o):t.setLocalStateField("current",null)})),t}},h={id:"@jupyter/collaboration-extension:rtcPanel",description:"Add side panel to display all currently connected users.",autoStart:!0,requires:[n.IGlobalAwareness],optional:[u.ITranslator],activate:(e,r,a)=>{const{user:o}=e.serviceManager,t=(null!=a?a:u.nullTranslator).load("jupyter_collaboration"),n=new i.SidePanel({alignment:"justify"});n.id="jp-collaboration-panel",n.title.icon=i.usersIcon,n.title.caption=t.__("Collaboration"),n.addClass("jp-RTCPanel"),e.shell.add(n,"left",{rank:300});const s=new m.UserInfoPanel({userManager:o,trans:t});s.title.label=t.__("User info"),s.title.caption=t.__("User information"),n.addWidget(s);const l=new m.CollaboratorsPanel(o,r,(r=>{e.commands.execute("docmanager:open",{path:r})}),e.docRegistry);l.title.label=t.__("Online Collaborators"),n.addWidget(l)}},_={id:"@jupyter/collaboration-extension:userEditorCursors",description:"Add CodeMirror extension to display remote user cursors and selections.",autoStart:!0,requires:[t.IEditorExtensionRegistry],activate:(e,r)=>{r.addExtension({name:"remote-user-cursors",factory(e){const{awareness:r,ysource:a}=e.model.sharedModel;return t.EditorExtensionRegistry.createImmutableExtension((0,m.remoteUserCursors)({awareness:r,ytext:a}))}})}};var x;!function(e){e.share="collaboration:shared-link"}(x||(x={}));const I=[w,v,g,h,{id:"@jupyter/collaboration-extension:shared-link",autoStart:!0,optional:[o.ICommandPalette,u.ITranslator],activate:async(e,r,a)=>{const{commands:t}=e,n=(null!=a?a:u.nullTranslator).load("jupyter_collaboration");t.addCommand(x.share,{label:n.__("Generate a Shared Link"),icon:i.shareIcon,execute:async()=>{const e=await(0,m.showSharedLinkDialog)({translator:a});e.button.accept&&e.value&&o.Clipboard.copyToSystem(e.value)}}),r&&r.addItem({command:x.share,category:n.__("Server")})}},_]}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _JUPYTERLAB;(()=>{"use strict";var e,r,t,a,o,n,i,l,u,s,f,d,c,p,h,b,v,m,y,g,j,w,P,S={1998:(e,r,t)=>{var a={"./index":()=>Promise.all([t.e(422),t.e(784),t.e(206),t.e(385),t.e(256),t.e(602),t.e(842)]).then((()=>()=>t(4842))),"./extension":()=>Promise.all([t.e(422),t.e(784),t.e(206),t.e(385),t.e(256),t.e(602),t.e(842)]).then((()=>()=>t(4842))),"./style":()=>t.e(944).then((()=>()=>t(5944)))},o=(e,r)=>(t.R=r,r=t.o(a,e)?a[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),n=(e,r)=>{if(t.S){var a="default",o=t.S[a];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[a]=e,t.I(a,r)}};t.d(r,{get:()=>o,init:()=>n})}},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:"61d3aa702c2fa861c087",393:"f5e8288bb3ed18ac084a",422:"c33fd4bf2f8b13b1f430",444:"d6f3cc1c6d4b374efa63",784:"586f70cab201cb43c954",842:"6243a771ad51bd0bf3f3",944:"27191c0195c19b79d6b0",952:"8934cdeb03f9bd1e666f"}[e]+".js?v="+{240:"61d3aa702c2fa861c087",393:"f5e8288bb3ed18ac084a",422:"c33fd4bf2f8b13b1f430",444:"d6f3cc1c6d4b374efa63",784:"586f70cab201cb43c954",842:"6243a771ad51bd0bf3f3",944:"27191c0195c19b79d6b0",952:"8934cdeb03f9bd1e666f"}[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/collaboration-extension:",x.l=(t,a,o,n)=>{if(e[t])e[t].push(a);else{var i,l;if(void 0!==o)for(var u=document.getElementsByTagName("script"),s=0;s<u.length;s++){var f=u[s];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+o){i=f;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+o),i.src=t),e[t]=[a];var d=(r,a)=>{i.onerror=i.onload=null,clearTimeout(c);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(a))),r)return r(a)},c=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.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,a)=>{a||(a=[]);var o=r[t];if(o||(o=r[t]={}),!(a.indexOf(o)>=0)){if(a.push(o),e[t])return e[t];x.o(x.S,t)||(x.S[t]={});var n=x.S[t],i="@jupyter/collaboration-extension",l=(e,r,t,a)=>{var o=n[e]=n[e]||{},l=o[r];(!l||!l.loaded&&(!a!=!l.eager?a:i>l.from))&&(o[r]={get:t,from:i,eager:!!a})},u=[];return"default"===t&&(l("@jupyter/collaboration-extension","4.1.2",(()=>Promise.all([x.e(422),x.e(784),x.e(206),x.e(385),x.e(256),x.e(602),x.e(842)]).then((()=>()=>x(4842))))),l("@jupyter/collaboration","4.1.2",(()=>Promise.all([x.e(206),x.e(262),x.e(385),x.e(312),x.e(256),x.e(393)]).then((()=>()=>x(6393))))),l("@jupyter/collaborative-drive","4.1.2",(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),l("@jupyter/docprovider","4.1.2",(()=>Promise.all([x.e(422),x.e(262),x.e(385),x.e(312),x.e(240)]).then((()=>()=>x(6240))))),l("y-websocket","1.5.4",(()=>Promise.all([x.e(422),x.e(784),x.e(952),x.e(206)]).then((()=>()=>x(2952)))))),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 a=t.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=t[a--].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),a=t[1]?r(t[1]):[];return t[2]&&(a.length++,a.push.apply(a,r(t[2]))),t[3]&&(a.push([]),a.push.apply(a,r(t[3]))),a},a=(e,r)=>{e=t(e),r=t(r);for(var a=0;;){if(a>=e.length)return a<r.length&&"u"!=(typeof r[a])[0];var o=e[a],n=(typeof o)[0];if(a>=r.length)return"u"==n;var i=r[a],l=(typeof i)[0];if(n!=l)return"o"==n&&"n"==l||"s"==l||"u"==n;if("o"!=n&&"u"!=n&&o!=i)return o<i;a++}},o=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 a=1,n=1;n<e.length;n++)a--,t+="u"==(typeof(l=e[n]))[0]?"-":(a>0?".":"")+(a=2,l);return t}var i=[];for(n=1;n<e.length;n++){var l=e[n];i.push(0===l?"not("+u()+")":1===l?"("+u()+" || "+u()+")":2===l?i.pop()+" "+i.pop():o(l))}return u();function u(){return i.pop().replace(/^\((.+)\)$/,"$1")}},n=(e,r)=>{if(0 in e){r=t(r);var a=e[0],o=a<0;o&&(a=-a-1);for(var i=0,l=1,u=!0;;l++,i++){var s,f,d=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(f=(typeof(s=r[i]))[0]))return!u||("u"==d?l>a&&!o:""==d!=o);if("u"==f){if(!u||"u"!=d)return!1}else if(u)if(d==f)if(l<=a){if(s!=e[l])return!1}else{if(o?s>e[l]:s<e[l])return!1;s!=e[l]&&(u=!1)}else if("s"!=d&&"n"!=d){if(o||l<=a)return!1;u=!1,l--}else{if(l<=a||f<d!=o)return!1;u=!1}else"s"!=d&&"n"!=d&&(u=!1,l--)}}var c=[],p=c.pop.bind(c);for(i=1;i<e.length;i++){var h=e[i];c.push(1==h?p()|p():2==h?p()&p():h?n(h,r):!p())}return!!p()},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,o)=>{var i=o?u(e[r]):e[r];return(r=Object.keys(i).reduce(((e,r)=>!n(t,r)||e&&!a(e,r)?e:r),0))&&i[r]},f=(e,r,t)=>{var o=t?u(e[r]):e[r];return Object.keys(o).reduce(((e,r)=>!e||!o[e].loaded&&a(e,r)?r:e),0)},d=(e,r,t,a)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(a)+")",c=(e,r,t,a,n)=>{var i=e[t];return"No satisfying version ("+o(a)+")"+(n?" 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(", ")},p=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},v=(e,r,t)=>t?t():((e,r)=>p("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),m=(b=e=>function(r,t,a,o,n){var i=x.I(r);return i&&i.then&&!a?i.then(e.bind(e,r,x.S[r],t,!1,o,n)):e(r,x.S[r],t,a,o,n)})(((e,r,t,a,o,n)=>{if(!i(r,t))return v(e,t,n);var u=s(r,t,o,a);return u?l(u):n?n():void p(c(r,e,t,o,a))})),y=b(((e,r,t,a,o,u)=>{if(!i(r,t))return v(e,t,u);var s=f(r,t,a);return n(o,s)||h(d(r,t,s,o)),l(r[t][s])})),g={},j={2206:()=>y("default","yjs",!1,[1,13,5,40]),1297:()=>y("default","@jupyterlab/coreutils",!1,[1,6,4,10]),2986:()=>y("default","@jupyterlab/apputils",!1,[1,4,5,10]),6860:()=>y("default","@jupyterlab/services",!1,[1,7,4,10]),9424:()=>y("default","@jupyterlab/translation",!1,[1,4,4,10]),9694:()=>y("default","@jupyterlab/ui-components",!1,[1,4,4,10]),5256:()=>y("default","@lumino/widgets",!1,[1,2,3,1,,"alpha",0]),1935:()=>y("default","@jupyter/collaboration",!1,[1,4,1,2],(()=>Promise.all([x.e(262),x.e(312),x.e(393)]).then((()=>()=>x(6393))))),4337:()=>y("default","@jupyterlab/codemirror",!1,[1,4,4,10]),6247:()=>y("default","@jupyter/collaborative-drive",!1,[1,4,1,2],(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),8963:()=>y("default","@jupyter/docprovider",!1,[1,4,1,2],(()=>Promise.all([x.e(262),x.e(312),x.e(240)]).then((()=>()=>x(6240))))),9404:()=>y("default","@jupyterlab/statedb",!1,[1,4,4,10]),7262:()=>y("default","@lumino/coreutils",!1,[1,2,0,0]),3345:()=>y("default","react",!1,[1,18,2,0]),4602:()=>y("default","@lumino/signaling",!1,[1,2,0,0]),195:()=>y("default","@codemirror/state",!1,[1,6,2,0]),4873:()=>y("default","@lumino/virtualdom",!1,[1,2,0,0]),5024:()=>y("default","@codemirror/view",!1,[1,6,9,6]),3560:()=>m("default","y-websocket",!1,[1,1,3,15],(()=>Promise.all([x.e(784),x.e(952),x.e(206)]).then((()=>()=>x(2952)))))},w={206:[2206],240:[3560],256:[5256],262:[7262],312:[3345,4602],385:[1297,2986,6860,9424,9694],393:[195,4873,5024],602:[1935,4337,6247,8963,9404]},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 a=r=>{delete g[e],x.m[e]=t=>{throw delete x.c[e],r}};try{var o=j[e]();o.then?r.push(g[e]=o.then(t).catch(a)):t(o)}catch(e){a(e)}}}))},(()=>{var e={270:0};x.f.j=(r,t)=>{var a=x.o(e,r)?e[r]:void 0;if(0!==a)if(a)t.push(a[2]);else if(/^(2(06|56|62)|312|385|602)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>a=e[r]=[t,o]));t.push(a[2]=o);var n=x.p+x.u(r),i=new Error;x.l(n,(t=>{if(x.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+n+")",i.name="ChunkLoadError",i.type=o,i.request=n,a[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var a,o,[n,i,l]=t,u=0;if(n.some((r=>0!==e[r]))){for(a in i)x.o(i,a)&&(x.m[a]=i[a]);l&&l(x)}for(r&&r(t);u<n.length;u++)o=n[u],x.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),x.nc=void 0;var E=x(1998);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["@jupyter/collaboration-extension"]=E})();
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
"packages": [
|
|
3
3
|
{
|
|
4
4
|
"name": "@jupyter/collaboration",
|
|
5
|
-
"versionInfo": "4.1.
|
|
5
|
+
"versionInfo": "4.1.2",
|
|
6
6
|
"licenseId": "BSD-3-Clause",
|
|
7
7
|
"extractedText": ""
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "@jupyter/collaborative-drive",
|
|
11
|
-
"versionInfo": "4.1.
|
|
11
|
+
"versionInfo": "4.1.2",
|
|
12
12
|
"licenseId": "BSD-3-Clause",
|
|
13
13
|
"extractedText": ""
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"name": "@jupyter/docprovider",
|
|
17
|
-
"versionInfo": "4.1.
|
|
17
|
+
"versionInfo": "4.1.2",
|
|
18
18
|
"licenseId": "BSD-3-Clause",
|
|
19
19
|
"extractedText": ""
|
|
20
20
|
},
|
|
@@ -134,12 +134,11 @@ export async function showSharedLinkDialog({
|
|
|
134
134
|
serverOwner = PageConfig.getOption('hubServerUser');
|
|
135
135
|
serverName = PageConfig.getOption('hubServerName');
|
|
136
136
|
// Prepare the Hub API URL
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const port = window.location.port;
|
|
137
|
+
// hubHost is the full Origin (`proto://hostname:port`)
|
|
138
|
+
// or an empty string, making hubApiUrl an absolute path on the current origin
|
|
139
|
+
const hubHost = PageConfig.getOption('hubHost') || '';
|
|
141
140
|
const prefix = PageConfig.getOption('hubPrefix');
|
|
142
|
-
hubApiUrl = `${
|
|
141
|
+
hubApiUrl = `${hubHost}${prefix}api`;
|
|
143
142
|
// Check Hub version for share compatibility (>= 5.0)
|
|
144
143
|
const response = await fetch(hubApiUrl, {
|
|
145
144
|
// A GET request on base API url returns the Hub version
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/collaboration-extension",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "JupyterLab - Real-Time Collaboration Extension",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"watch:labextension": "jupyter labextension watch ."
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jupyter/collaboration": "^4.1.
|
|
57
|
-
"@jupyter/collaborative-drive": "^4.1.
|
|
58
|
-
"@jupyter/docprovider": "^4.1.
|
|
56
|
+
"@jupyter/collaboration": "^4.1.2",
|
|
57
|
+
"@jupyter/collaborative-drive": "^4.1.2",
|
|
58
|
+
"@jupyter/docprovider": "^4.1.2",
|
|
59
59
|
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
|
|
60
60
|
"@jupyterlab/application": "^4.4.0",
|
|
61
61
|
"@jupyterlab/apputils": "^4.4.0",
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
|
|
4
4
|
import { IAwareness } from '@jupyter/ydoc';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Contents,
|
|
7
|
+
IContentProvider,
|
|
8
|
+
SharedDocumentFactory
|
|
9
|
+
} from '@jupyterlab/services';
|
|
6
10
|
import { IDisposable } from '@lumino/disposable';
|
|
7
11
|
|
|
8
12
|
import { Token } from '@lumino/coreutils';
|
|
@@ -22,7 +26,7 @@ export const IGlobalAwareness = new Token<IAwareness>(
|
|
|
22
26
|
'@jupyter/collaboration:IGlobalAwareness'
|
|
23
27
|
);
|
|
24
28
|
|
|
25
|
-
export interface ICollaborativeContentProvider {
|
|
29
|
+
export interface ICollaborativeContentProvider extends IContentProvider {
|
|
26
30
|
/**
|
|
27
31
|
* SharedModel factory for the YDrive.
|
|
28
32
|
*/
|
{jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/package.json
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/docprovider",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "JupyterLab - Document Provider",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyter-collaboration",
|
|
6
6
|
"bugs": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"watch": "tsc -b --watch"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@jupyter/collaborative-drive": "^4.1.
|
|
44
|
+
"@jupyter/collaborative-drive": "^4.1.2",
|
|
45
45
|
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
|
|
46
46
|
"@jupyterlab/apputils": "^4.4.0",
|
|
47
47
|
"@jupyterlab/cells": "^4.4.0",
|
{jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/ydrive.ts
RENAMED
|
@@ -14,7 +14,12 @@ import {
|
|
|
14
14
|
import { PromiseDelegate } from '@lumino/coreutils';
|
|
15
15
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
DocumentChange,
|
|
19
|
+
ISharedDocument,
|
|
20
|
+
StateChange,
|
|
21
|
+
YDocument
|
|
22
|
+
} from '@jupyter/ydoc';
|
|
18
23
|
|
|
19
24
|
import { WebSocketProvider } from './yprovider';
|
|
20
25
|
import {
|
|
@@ -49,6 +54,7 @@ namespace RtcContentProvider {
|
|
|
49
54
|
trans: TranslationBundle;
|
|
50
55
|
globalAwareness: Awareness | null;
|
|
51
56
|
docmanagerSettings: ISettingRegistry.ISettings | null;
|
|
57
|
+
fileChanged?: ISignal<Contents.IDrive, Contents.IChangedArgs>;
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
60
|
|
|
@@ -65,6 +71,7 @@ export class RtcContentProvider
|
|
|
65
71
|
this.sharedModelFactory = new SharedModelFactory(this._onCreate);
|
|
66
72
|
this._providers = new Map<string, WebSocketProvider>();
|
|
67
73
|
this._docmanagerSettings = options.docmanagerSettings;
|
|
74
|
+
this._driveFileChanged = options.fileChanged;
|
|
68
75
|
}
|
|
69
76
|
|
|
70
77
|
/**
|
|
@@ -189,6 +196,10 @@ export class RtcContentProvider
|
|
|
189
196
|
content: false
|
|
190
197
|
};
|
|
191
198
|
return this.get(localPath, fetchOptions);
|
|
199
|
+
} else {
|
|
200
|
+
console.warn(
|
|
201
|
+
`Could not find a provider for ${localPath}, falling back to REST API save`
|
|
202
|
+
);
|
|
192
203
|
}
|
|
193
204
|
}
|
|
194
205
|
|
|
@@ -199,7 +210,7 @@ export class RtcContentProvider
|
|
|
199
210
|
* A signal emitted when a file operation takes place.
|
|
200
211
|
*/
|
|
201
212
|
get fileChanged(): ISignal<this, Contents.IChangedArgs> {
|
|
202
|
-
return this.
|
|
213
|
+
return this._providerFileChanged;
|
|
203
214
|
}
|
|
204
215
|
|
|
205
216
|
private _onCreate = (
|
|
@@ -241,13 +252,99 @@ export class RtcContentProvider
|
|
|
241
252
|
this._globalAwareness?.setLocalStateField('documents', documents);
|
|
242
253
|
}
|
|
243
254
|
|
|
244
|
-
|
|
255
|
+
let path = options.path;
|
|
256
|
+
let key = `${options.format}:${options.contentType}:${path}`;
|
|
245
257
|
this._providers.set(key, provider);
|
|
246
258
|
|
|
259
|
+
const handlePathChange = (
|
|
260
|
+
pathChange: StateChange<string | undefined>
|
|
261
|
+
) => {
|
|
262
|
+
const oldPath = pathChange.oldValue;
|
|
263
|
+
const newPath = pathChange.newValue;
|
|
264
|
+
if (!oldPath || !newPath) {
|
|
265
|
+
// This is expected when shared model initializes and the path is first populated
|
|
266
|
+
console.debug('New or old path not given', pathChange);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const oldKey = `${options.format}:${options.contentType}:${oldPath}`;
|
|
271
|
+
if (oldKey !== key) {
|
|
272
|
+
console.error(
|
|
273
|
+
'The computed old provider key is different from the current key'
|
|
274
|
+
);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const newKey = `${options.format}:${options.contentType}:${newPath}`;
|
|
278
|
+
|
|
279
|
+
// Check if the provider is still registered (it may have been disposed if document was closed)
|
|
280
|
+
const provider = this._providers.get(oldKey);
|
|
281
|
+
if (!provider) {
|
|
282
|
+
console.warn(
|
|
283
|
+
`Could not find a provider to update after rename ${oldKey}, ${newKey}`
|
|
284
|
+
);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Re-register the provider under the new key
|
|
289
|
+
this._providers.set(newKey, provider);
|
|
290
|
+
this._providers.delete(oldKey);
|
|
291
|
+
|
|
292
|
+
// Update the provider key so that it can be disposed correctly when shared document closes
|
|
293
|
+
key = newKey;
|
|
294
|
+
path = newPath;
|
|
295
|
+
|
|
296
|
+
// Update the documents field
|
|
297
|
+
const state = this._globalAwareness?.getLocalState() || {};
|
|
298
|
+
const documents: string[] = state.documents || [];
|
|
299
|
+
const oldPathIndex = documents.indexOf(oldPath);
|
|
300
|
+
if (documents.includes(oldPath) && !documents.includes(newPath)) {
|
|
301
|
+
documents.splice(oldPathIndex, 1);
|
|
302
|
+
documents.push(newPath);
|
|
303
|
+
this._globalAwareness?.setLocalStateField('documents', documents);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
// The information about file being renamed can come from two places:
|
|
308
|
+
// - from the sharedModel via changed signal with documentChange
|
|
309
|
+
// - from the fileChanged signal of the drive
|
|
310
|
+
// Neither method is foolproof:
|
|
311
|
+
// - the shared model approach can be delayed as the change needs to be
|
|
312
|
+
// reflected by the server and come back, in which case we get a race condition
|
|
313
|
+
// - the fileChanged signal is emitted with a larger delay for renames of collaborators
|
|
314
|
+
// Thus we need both.
|
|
315
|
+
const handleFileChangedSignal = (
|
|
316
|
+
_: Contents.IDrive,
|
|
317
|
+
change: Contents.IChangedArgs
|
|
318
|
+
) => {
|
|
319
|
+
if (change.type !== 'rename') {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
const oldPath = change.oldValue?.path;
|
|
323
|
+
const newPath = change.newValue?.path;
|
|
324
|
+
if (oldPath !== path) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
handlePathChange({
|
|
328
|
+
oldValue: oldPath,
|
|
329
|
+
newValue: newPath,
|
|
330
|
+
name: 'path'
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
this._driveFileChanged?.connect(handleFileChangedSignal);
|
|
335
|
+
|
|
247
336
|
sharedModel.changed.connect(async (_, change) => {
|
|
248
337
|
if (!change.stateChange) {
|
|
249
338
|
return;
|
|
250
339
|
}
|
|
340
|
+
|
|
341
|
+
const pathChanges = change.stateChange.filter(
|
|
342
|
+
change => change.name === 'path'
|
|
343
|
+
);
|
|
344
|
+
for (const pathChange of pathChanges) {
|
|
345
|
+
handlePathChange(pathChange);
|
|
346
|
+
}
|
|
347
|
+
|
|
251
348
|
const hashChanges = change.stateChange.filter(
|
|
252
349
|
change => change.name === 'hash'
|
|
253
350
|
);
|
|
@@ -267,7 +364,7 @@ export class RtcContentProvider
|
|
|
267
364
|
const newPath = sharedModel.state.path ?? options.path;
|
|
268
365
|
const model = await this.get(newPath as string, { content: false });
|
|
269
366
|
|
|
270
|
-
this.
|
|
367
|
+
this._providerFileChanged.emit({
|
|
271
368
|
type: 'save',
|
|
272
369
|
newValue: { ...model, hash: hashChange.newValue },
|
|
273
370
|
// we do not have the old model because it was discarded when server made the change,
|
|
@@ -285,12 +382,15 @@ export class RtcContentProvider
|
|
|
285
382
|
|
|
286
383
|
// Remove the document path from the list of opened ones for this user.
|
|
287
384
|
const state = this._globalAwareness?.getLocalState() || {};
|
|
288
|
-
const documents:
|
|
289
|
-
const index = documents.indexOf(
|
|
385
|
+
const documents: string[] = state.documents || [];
|
|
386
|
+
const index = documents.indexOf(path);
|
|
290
387
|
if (index > -1) {
|
|
291
388
|
documents.splice(index, 1);
|
|
292
389
|
}
|
|
293
390
|
this._globalAwareness?.setLocalStateField('documents', documents);
|
|
391
|
+
|
|
392
|
+
// Disconnect signal
|
|
393
|
+
this._driveFileChanged?.disconnect(handleFileChangedSignal);
|
|
294
394
|
});
|
|
295
395
|
} catch (error) {
|
|
296
396
|
// Falling back to the contents API if opening the websocket failed
|
|
@@ -306,7 +406,10 @@ export class RtcContentProvider
|
|
|
306
406
|
private _trans: TranslationBundle;
|
|
307
407
|
private _globalAwareness: Awareness | null;
|
|
308
408
|
private _providers: Map<string, WebSocketProvider>;
|
|
309
|
-
|
|
409
|
+
// This is for emitting signals to be proxied to `Drive.fileChanged`
|
|
410
|
+
private _providerFileChanged = new Signal<this, Contents.IChangedArgs>(this);
|
|
411
|
+
// This is for listening to `Drive.fileChanged` signal
|
|
412
|
+
private _driveFileChanged?: ISignal<Contents.IDrive, Contents.IChangedArgs>;
|
|
310
413
|
private _serverSettings: ServerConnection.ISettings;
|
|
311
414
|
private _docmanagerSettings: ISettingRegistry.ISettings | null;
|
|
312
415
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/docprovider-extension",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "JupyterLab - Collaborative Shared Models",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"watch:labextension": "jupyter labextension watch ."
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jupyter/collaborative-drive": "^4.1.
|
|
57
|
-
"@jupyter/docprovider": "^4.1.
|
|
56
|
+
"@jupyter/collaborative-drive": "^4.1.2",
|
|
57
|
+
"@jupyter/docprovider": "^4.1.2",
|
|
58
58
|
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
|
|
59
59
|
"@jupyterlab/application": "^4.4.0",
|
|
60
60
|
"@jupyterlab/apputils": "^4.4.0",
|
|
@@ -86,7 +86,8 @@ export const rtcContentProvider: JupyterFrontEndPlugin<ICollaborativeContentProv
|
|
|
86
86
|
user: app.serviceManager.user,
|
|
87
87
|
trans,
|
|
88
88
|
globalAwareness,
|
|
89
|
-
docmanagerSettings
|
|
89
|
+
docmanagerSettings,
|
|
90
|
+
fileChanged: defaultDrive.fileChanged
|
|
90
91
|
});
|
|
91
92
|
registry.register('rtc', rtcContentProvider);
|
|
92
93
|
return rtcContentProvider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.1.1"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[240],{5068:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),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}},6758:e=>{e.exports=function(e){return e[1]}},2591: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,u="".concat(l," ").concat(d);s[l]=d+1;var h=n(u),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var m=r(p,o);o.byIndex=a,t.splice(a,0,{identifier:u,updater:m,references:1})}i.push(u)}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}}},8128: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)}},3051: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)}},1740: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)}}}},3656: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))}}},6240:(e,t,n)=>{n.r(t),n.d(t,{ForkManager:()=>V,IForkManagerToken:()=>K,JUPYTER_COLLABORATION_FORK_EVENTS_URI:()=>z,NotebookCellServerExecutor:()=>l,ROOM_FORK_URL:()=>p,RtcContentProvider:()=>C,TimelineWidget:()=>q,WebSocketAwarenessProvider:()=>r,WebSocketProvider:()=>w,requestAPI:()=>m,requestDocSession:()=>v,requestDocumentTimeline:()=>f,requestUndoRedo:()=>g});var o=n(3560);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(9715),i=n(2310),a=n(1269),c=n(1593);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:u}){var h,p,m;const v=(u=null!=u?u: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:v.__("Kernel Terminating"),body:v.__("The kernel for %1 appears to be terminating. You can not run any cell for now.",null===(h=l.session)||void 0===h?void 0:h.path),buttons:[s.Dialog.okButton()]});break}if(l.pendingInput)return await(0,s.showDialog)({title:v.__("Cell not executed due to pending input"),body:v.__("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`),u=e.model.sharedModel.getId(),f=t.sharedModel.getState("document_id"),g={method:"POST",body:JSON.stringify({cell_id:u,document_id:f})};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",u="api/collaboration/undo_redo",h="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 v(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 f(e,t,n){const o=a.ServerConnection.makeSettings();let r=i.URLExt.join(o.baseUrl,h,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,u,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(7262),_=n(4602);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 y.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(),_.Signal.clearData(this))}async reconnect(){this._disconnect(),this._connect()}async _connect(){const e=await v(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)}}var S=n(3721),b=n(6214);const k="true"===i.PageConfig.getOption("disableRTC");class C extends a.RestContentProvider{constructor(e){super(e),this._onCreate=(e,t)=>{var n,o,r,s,a,c;if("string"!=typeof e.format)return;const l=null===(r=null===(o=null===(n=this._docmanagerSettings)||void 0===n?void 0:n.composite)||void 0===o?void 0:o.autosave)||void 0===r||r;t.awareness.setLocalStateField("autosave",l),null===(s=this._docmanagerSettings)||void 0===s||s.changed.connect((()=>{var e,n,o;const r=null===(o=null===(n=null===(e=this._docmanagerSettings)||void 0===e?void 0:e.composite)||void 0===n?void 0:n.autosave)||void 0===o||o;t.awareness.setLocalStateField("autosave",r)}));try{const n=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}),o=((null===(a=this._globalAwareness)||void 0===a?void 0:a.getLocalState())||{}).documents||[];o.includes(e.path)||(o.push(e.path),null===(c=this._globalAwareness)||void 0===c||c.setLocalStateField("documents",o));const r=`${e.format}:${e.contentType}:${e.path}`;this._providers.set(r,n),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(r);o&&(o.dispose(),this._providers.delete(r));const s=((null===(t=this._globalAwareness)||void 0===t?void 0:t.getLocalState())||{}).documents||[],i=s.indexOf(e.path);i>-1&&s.splice(i,1),null===(n=this._globalAwareness)||void 0===n||n.setLocalStateField("documents",s)}))}catch(t){console.error(`Failed to open websocket connection for ${e.path}.\n:${t}`)}},this._saveCounter=0,this._ydriveFileChanged=new _.Signal(this),this._user=e.user,this._trans=e.trans,this._globalAwareness=e.globalAwareness,this._serverSettings=e.serverSettings,this.sharedModelFactory=new T(this._onCreate),this._providers=new Map,this._docmanagerSettings=e.docmanagerSettings}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={}){var n;if(t.format&&t.type){const o=`${t.format}:${t.type}:${e}`,r=this._providers.get(o),s=++this._saveCounter;if(r){const o=null===(n=r.wsProvider)||void 0===n?void 0:n.ws;if(o){const e=new y.PromiseDelegate,t=t=>{const n=new Uint8Array(t.data),o=S.$C(n);try{if(2!==S.cw(o))return}catch(e){return}const r=S.t3(o);let i=null;try{i=JSON.parse(r)}catch(e){console.debug("The raw reply received was not a JSON reply")}i&&"save"===i.type&&i.responseTo===s&&("success"===i.status?e.resolve():"failed"===i.status?e.reject("Saving failed"):"skipped"===i.status?e.reject("Saving already in progress"):e.reject("Unrecognised save reply status"))};o.addEventListener("message",t);const n=b.xv();b.zd(n,2),b.Qj(n,"save"),b.zd(n,s);const r=b.Fo(n);o.send(r),await e.promise,o.removeEventListener("message",t)}const i={type:t.type,format:t.format,content:!1};return this.get(e,i)}}return super.save(e,t)}get fileChanged(){return this._ydriveFileChanged}}class T{constructor(e){this._onCreate=e,this.collaborative=!k,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 E=n(3345),x=n.n(E),R=n(2591),U=n.n(R),D=n(1740),P=n.n(D),$=n(8128),j=n.n($),N=n(855),L=n.n(N),I=n(3051),M=n.n(I),F=n(3656),A=n.n(F),W=n(5068),O={};O.styleTagTransform=A(),O.setAttributes=L(),O.insert=j().bind(null,"head"),O.domAPI=P(),O.insertStyleElement=M(),U()(W.A,O),W.A&&W.A.locals&&W.A.locals;var J=n(9159);const B=({apiURL:e,provider:t,contentType:n,format:o,documentTimelineUrl:r})=>{const[i,a]=(0,E.useState)({roomId:"",timestamps:[],forkRoom:"",sessionId:""}),[c,l]=(0,E.useState)(i.timestamps.length-1),[d,u]=(0,E.useState)(!1),[h,p]=(0,E.useState)(!1),m=(0,E.useRef)(!0),y=(0,E.useRef)(!0),_=(0,E.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 x().createElement("div",{className:"jp-sliderContainer"},x().createElement("div",{onClick:()=>{!async function(r){try{if(m.current){const i=await f(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 v(o,n,w(e))),u(!0),m.current=!1,d}}catch(e){console.error("Error fetching data:",e)}}(w(e))},className:"jp-mod-highlighted",title:"Document Timeline"},x().createElement(J.historyIcon.react,{marginRight:"4px"})),d&&x().createElement("div",{className:"jp-timestampDisplay"},x().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"}),x().createElement("div",null,x().createElement("strong",null,w(e).split("/").pop()," ")," "),h&&x().createElement("div",{className:"jp-restoreBtnContainer"},x().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(),u(!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 q 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 E.createElement(B,{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 K=new y.Token("@jupyter/docprovider:IForkManagerToken"),z="https://schema.jupyter.org/jupyter_collaboration/fork/v1";class V{constructor(e){this._disposed=!1,this._forkAddedSignal=new _.Signal(this),this._forkDeletedSignal=new _.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===z)switch(t.action){case"create":this._forkAddedSignal.emit(t);break;case"delete":this._forkDeletedSignal.emit(t)}}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[393],{6393:(e,t,s)=>{s.r(t),s.d(t,{Collaborator:()=>C,CollaboratorsBody:()=>b,CollaboratorsPanel:()=>y,DefaultIconRenderer:()=>G,IUserMenu:()=>r,RendererUserMenu:()=>P,UserInfoBody:()=>V,UserInfoPanel:()=>z,UserMenu:()=>N,UsersItem:()=>q,remoteUserCursors:()=>U,showSharedLinkDialog:()=>O});var n=s(7262);const r=new n.Token("@jupyter/collaboration:IUserMenu");var a=s(9715),o=s(9159),i=s(4602),l=s(5256),c=s(3345),d=s.n(c);const h="jp-CollaboratorsList",u="jp-Collaborator",p="jp-CollaboratorHeader",_="jp-CollaboratorHeaderCollapser",m="jp-ClickableCollaborator",v="jp-CollaboratorIcon",g="jp-CollaboratorFiles",f="jp-CollaboratorFile";class y extends l.Panel{constructor(e,t,s,n){super({}),this._onAwarenessChanged=()=>{const e=this._awareness.getStates(),t=new Map;e.forEach(((e,s)=>{if(this._currentUser.isReady&&e.user&&e.user.username!==this._currentUser.identity.username){const s=`${e.user.username}-${e.current||"no-current"}`;t.has(s)||t.set(s,e)}})),this._collaboratorsChanged.emit(Array.from(t.values()))},this._collaboratorsChanged=new i.Signal(this),this._awareness=t,this._currentUser=e,this.addClass("jp-CollaboratorsPanel"),this.addWidget(a.ReactWidget.create(d().createElement(b,{fileopener:s,collaboratorsChanged:this._collaboratorsChanged,docRegistry:n}))),this._awareness.on("change",this._onAwarenessChanged)}}function b(e){const[t,s]=(0,c.useState)([]);return e.collaboratorsChanged.connect(((e,t)=>{s(t)})),d().createElement("div",{className:h},t.map((t=>{const s=`${t.user.username}-${t.current||"no-current"}`;return d().createElement(C,{key:s,collaborator:t,fileopener:e.fileopener,docRegistry:e.docRegistry})})))}function C(e){const[t,s]=(0,c.useState)(!1),{collaborator:n,fileopener:r}=e;let a="";if(n.current){const e=n.current.split(":");a=`${e[1]}`}const i=n.documents||[],l=i.map((t=>{var s,n;const r=null===(n=null===(s=e.docRegistry)||void 0===s?void 0:s.getFileTypesForPath(t))||void 0===n?void 0:n.filter((e=>void 0!==e.icon)),a=(null==r?void 0:r.length)?r[0].icon:o.fileIcon,i=(null==r?void 0:r.length)?r[0].iconClass:void 0;return{filename:t.length>40?t.slice(0,10).concat("…").concat(t.slice(t.length-15)):t,fileLocation:t,icon:a,iconClass:i}}));return d().createElement("div",{className:u},d().createElement("div",{className:l.length?`${m} ${p}`:p,onClick:i?()=>{l.length&&s(!t)}:void 0},d().createElement(o.LabIcon.resolveReact,{icon:o.caretDownIcon,className:_+(t?" jp-mod-expanded":""),tag:"div"}),d().createElement("div",{className:v,style:{backgroundColor:n.user.color}},d().createElement("span",null,n.user.initials)),d().createElement("span",null,n.user.display_name)),d().createElement("div",{className:`${g} jp-DirListing`,style:t?{}:{display:"none"}},d().createElement("ul",{className:"jp-DirListing-content"},l.map((e=>d().createElement("li",{className:"jp-DirListing-item "+(e.fileLocation===a?`${f} jp-mod-running`:f),key:e.filename,onClick:()=>r(e.fileLocation)},d().createElement(o.LabIcon.resolveReact,{icon:e.icon,iconClass:e.iconClass,tag:"span",className:"jp-DirListing-itemIcon",stylesheet:"listing"}),d().createElement("span",{className:"jp-DirListing-itemText",title:e.fileLocation},e.filename)))))))}var w=s(195),k=s(5024),j=s(2206);const S=w.Facet.define({combine:e=>e[e.length-1]}),E=k.EditorView.baseTheme({".jp-remote-cursor":{borderLeft:"1px solid black",marginLeft:"-1px"},".jp-remote-cursor.jp-mod-primary":{borderLeftWidth:"2px"},".jp-remote-selection":{opacity:.5},".cm-tooltip":{border:"none"},".cm-tooltip .jp-remote-userInfo":{color:"var(--jp-ui-inverse-font-color0)",padding:"0px 2px"}}),x=w.Annotation.define();class L{constructor(e,t){this.style=e,this.marker=t}draw(){const e=this.marker.draw();for(const[t,s]of Object.entries(this.style))e.style[t]=s;return e}eq(e){return this.marker.eq(e.marker)&&n.JSONExt.deepEqual(this.style,e.style)}update(e,t){for(const[t,s]of Object.entries(this.style))e.style[t]=s;return this.marker.update(e,t.marker)}}const A=(0,k.layer)({above:!0,markers(e){const{awareness:t,ytext:s}=e.state.facet(S),n=s.doc,r=[];return t.getStates().forEach(((a,o)=>{var i,l,c;if(o===t.doc.clientID)return;const d=a.cursors;for(const t of null!=d?d:[]){if(!(null==t?void 0:t.anchor)||!(null==t?void 0:t.head))return;const o=(0,j.createAbsolutePositionFromRelativePosition)(t.anchor,n),d=(0,j.createAbsolutePositionFromRelativePosition)(t.head,n);if((null==o?void 0:o.type)!==s||(null==d?void 0:d.type)!==s)return;const h=null===(i=t.primary)||void 0===i||i?"jp-remote-cursor jp-mod-primary":"jp-remote-cursor",u=w.EditorSelection.cursor(d.index,d.index>o.index?-1:1);for(const t of k.RectangleMarker.forRange(e,h,u))r.push(new L({borderLeftColor:null!==(c=null===(l=a.user)||void 0===l?void 0:l.color)&&void 0!==c?c:"black"},t))}})),r},update:(e,t)=>!!e.transactions.find((e=>e.annotation(x))),class:"jp-remote-cursors"}),I=(0,k.hoverTooltip)(((e,t)=>{var s;const{awareness:n,ytext:r}=e.state.facet(S),a=r.doc;for(const[e,o]of n.getStates())if(e!==n.doc.clientID)for(const e of null!==(s=o.cursors)&&void 0!==s?s:[]){if(!(null==e?void 0:e.head))continue;const s=(0,j.createAbsolutePositionFromRelativePosition)(e.head,a);if((null==s?void 0:s.type)===r&&s.index-3<=t&&t<=s.index+3)return{pos:s.index,above:!0,create:()=>{var e,t,s,n;const r=document.createElement("div");return r.classList.add("jp-remote-userInfo"),r.style.backgroundColor=null!==(t=null===(e=o.user)||void 0===e?void 0:e.color)&&void 0!==t?t:"darkgrey",r.textContent=null!==(n=null===(s=o.user)||void 0===s?void 0:s.display_name)&&void 0!==n?n:"Anonymous",{dom:r}}}}return null}),{hideOn:(e,t)=>!!e.annotation(x),hoverTime:0}),M=(0,k.layer)({above:!1,markers(e){const{awareness:t,ytext:s}=e.state.facet(S),n=s.doc,r=[];return t.getStates().forEach(((a,o)=>{var i,l,c;if(o===t.doc.clientID)return;const d=a.cursors;for(const t of null!=d?d:[]){if(null===(i=t.empty)||void 0===i||i||!(null==t?void 0:t.anchor)||!(null==t?void 0:t.head))return;const o=(0,j.createAbsolutePositionFromRelativePosition)(t.anchor,n),d=(0,j.createAbsolutePositionFromRelativePosition)(t.head,n);if((null==o?void 0:o.type)!==s||(null==d?void 0:d.type)!==s)return;const h="jp-remote-selection";for(const t of k.RectangleMarker.forRange(e,h,w.EditorSelection.range(o.index,d.index)))r.push(new L({backgroundColor:null!==(c=null===(l=a.user)||void 0===l?void 0:l.color)&&void 0!==c?c:"black"},t))}})),r},update:(e,t)=>!!e.transactions.find((e=>e.annotation(x))),class:"jp-remote-selections"}),R=k.ViewPlugin.fromClass(class{constructor(e){this.editorAwareness=e.state.facet(S),this._listener=({added:t,updated:s,removed:n})=>{t.concat(s).concat(n).findIndex((e=>e!==this.editorAwareness.awareness.doc.clientID))>=0&&e.dispatch({annotations:[x.of([])]})},this.editorAwareness.awareness.on("change",this._listener)}destroy(){this.editorAwareness.awareness.off("change",this._listener)}update(e){var t;if(!e.docChanged&&!e.selectionSet)return;const{awareness:s,ytext:r}=this.editorAwareness,a=s.getLocalState();if(a){const o=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=e.state.selection,l=new Array;if(o&&i){for(const e of i.ranges){const t=e===i.main,s=(0,j.createRelativePositionFromTypeIndex)(r,e.anchor),n=(0,j.createRelativePositionFromTypeIndex)(r,e.head);l.push({anchor:s,head:n,primary:t,empty:e.empty})}if(!a.cursors||l.length>0){const e=null===(t=a.cursors)||void 0===t?void 0:t.map((e=>({...e,anchor:(null==e?void 0:e.anchor)?(0,j.createRelativePositionFromJSON)(e.anchor):null,head:(null==e?void 0:e.head)?(0,j.createRelativePositionFromJSON)(e.head):null})));n.JSONExt.deepEqual(l,e)||s.setLocalStateField("cursors",l)}}}}},{provide:()=>[E,A,M,I,(0,k.tooltips)({position:"absolute",parent:document.body})]});function U(e){return[S.of(e),R]}var D=s(4873);class P extends l.MenuBar.Renderer{constructor(e){super(),this._user=e}renderItem(e){const t=this.createItemClass(e),s=this.createItemDataset(e),n=this.createItemARIA(e);return D.h.li({className:t,dataset:s,tabindex:"0",onfocus:e.onfocus,...n},this._createUserIcon(),this.renderLabel(e),this.renderIcon(e))}renderLabel(e){const t=this.formatLabel(e);return D.h.div({className:"lm-MenuBar-itemLabel jp-MenuBar-label"},t)}_createUserIcon(){return this._user.isReady&&this._user.identity.avatar_url?D.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-imageIcon"},D.h.img({src:this._user.identity.avatar_url})):this._user.isReady?D.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-anonymousIcon",style:{backgroundColor:this._user.identity.color}},D.h.span({},this._user.identity.initials)):D.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-anonymousIcon"},o.userIcon)}}class N extends l.Menu{constructor(e){super(e)}}var T=s(2310),$=s(1593);async function O({translator:e}){const t=(null!=e?e:$.nullTranslator).load("jupyter_collaboration"),s=T.PageConfig.getToken(),n=new URL(T.URLExt.normalize(T.PageConfig.getUrl({workspace:T.PageConfig.defaultWorkspace})));let r=!1,o=!1,i=!1,l=!1,c="",d="",h="";if(""!==T.PageConfig.getOption("hubUser")){h=T.PageConfig.getOption("hubServerUser"),d=T.PageConfig.getOption("hubServerName"),c=`${window.location.protocol}//${T.PageConfig.getOption("hubHost")||window.location.hostname}:${window.location.port}${T.PageConfig.getOption("hubPrefix")}api`;const e=await fetch(c,{headers:{Authorization:`token ${s}`}}),t=(await e.json()).version,[n]=t.split(".").map(Number);if(n>=5){const e=await fetch(`${c}/user`,{headers:{Authorization:`token ${s}`}}),t=await e.json();t.scopes.includes("read:users:name")&&(h===T.PageConfig.getOption("hubUser")&&t.scopes.includes("shares!user")||t.scopes.includes("shares!user="+h)||t.scopes.includes("shares!server="+h+"/"+d))&&(r=!0,(t.scopes.includes("list:users")||t.scopes.includes("read:users")||t.scopes.includes("admin:users"))&&(o=!0),(t.scopes.includes("list:groups")||t.scopes.includes("read:groups")||t.scopes.includes("admin:groups"))&&(i=!0),(h===T.PageConfig.getOption("hubUser")&&t.scopes.includes("servers!user")||t.scopes.includes("servers!user="+h)||t.scopes.includes("servers!server="+h+"/"+d+"/")||t.scopes.includes("admin:servers"))&&(l=!0))}}if(r){let e=d;return""===e&&(e="default"),(0,a.showDialog)({title:t.__("Share Jupyter Server %1",e),body:new B(n.toString(),d,o,i,l,h,c,s,t),buttons:[a.Dialog.cancelButton({label:t.__("Close"),caption:t.__("Close the dialog")}),a.Dialog.okButton({label:t.__("Copy Link"),caption:t.__("Copy the link to the Jupyter Server")})]})}return(0,a.showDialog)({title:t.__("Share Jupyter Server Link"),body:new F(n.toString(),s,""!==T.PageConfig.getOption("hubUser"),t),buttons:[a.Dialog.cancelButton(),a.Dialog.okButton({label:t.__("Copy Link"),caption:t.__("Copy the link to the Jupyter Server")})]})}class B extends l.Widget{constructor(e,t,s,n,r,a,o,i,l){super(),this._url=e,this._serverName=t,this._canListUsers=s,this._canListGroups=n,this._canControlServer=r,this._serverOwner=a,this._hubApiUrl=o,this._token=i,this._trans=l,this._recipients=[],this._shares=[],this._searchInput=null,this._searchResults=null,this._sharesContainer=null,this._populateBody(this.node),this.addClass("jp-shared-link-body"),this._loadShares().then((()=>{this._updateSharesList().then((()=>{this._loadUsers()}))}))}getValue(){return this._url}onAfterAttach(e){super.onAfterAttach(e)}onBeforeDetach(e){super.onBeforeDetach(e)}async _loadUsers(){if(this._canListUsers){let e=0;const t=200;let s=[],n=!0;for(;n;){const r=await fetch(`${this._hubApiUrl}/users?limit=${t}&offset=${e}`,{headers:{Authorization:`token ${this._token}`}}),a=await r.json();s=s.concat(a),n=a.length===t,e+=t}const r=new Set(this._shares.filter((e=>"user"===e.type)).map((e=>e.name)));this._recipients=s.filter((e=>e.name!==this._serverOwner&&!r.has(e.name))).map((e=>({...e,type:"user"})))}if(this._canListGroups){const e=await fetch(`${this._hubApiUrl}/groups`,{headers:{Authorization:`token ${this._token}`}}),t=await e.json(),s=new Set(this._shares.filter((e=>"group"===e.type)).map((e=>e.name)));this._recipients=this._recipients.concat(t.filter((e=>!s.has(e.name))).map((e=>({name:e.name,type:"group"}))))}this._recipients.sort(((e,t)=>e.name.localeCompare(t.name))),this._updateSearchResults()}async _loadShares(){const e=await fetch(`${this._hubApiUrl}/shares/${this._serverOwner}/${this._serverName}`,{headers:{Authorization:`token ${this._token}`}}),t=await e.json();this._shares=t.items.map((e=>{var t,s;return{name:(null===(t=e.user)||void 0===t?void 0:t.name)||(null===(s=e.group)||void 0===s?void 0:s.name),createdAt:e.created_at,type:e.user?"user":"group"}}))}async _createShare(e,t){const s=["access:servers!server="+this._serverOwner+"/"+this._serverName];this._canControlServer&&s.push("servers!server="+this._serverOwner+"/"+this._serverName),await fetch(`${this._hubApiUrl}/shares/${this._serverOwner}/${this._serverName}`,{method:"POST",headers:{Authorization:`token ${this._token}`,"Content-Type":"application/json"},body:JSON.stringify({[t]:e.name,scopes:s})})}async _deleteShare(e,t){await fetch(`${this._hubApiUrl}/shares/${this._serverOwner}/${this._serverName}`,{method:"PATCH",headers:{Authorization:`token ${this._token}`},body:JSON.stringify({[t]:e.name})})}_populateBody(e){const t=document.createElement("div");t.classList.add("jp-ManageSharesBody-search-container"),this._searchInput=document.createElement("input"),this._searchInput.type="text",this._searchInput.classList.add("jp-ManageSharesBody-search-input"),this._searchInput.placeholder=this._trans.__("Type to search for a user or a group to share your server with..."),this._searchInput.addEventListener("input",(()=>{this._updateSearchResults()})),t.appendChild(this._searchInput),e.appendChild(t),this._searchResults=document.createElement("div"),this._searchResults.classList.add("jp-ManageSharesBody-search-results"),e.appendChild(this._searchResults),this._sharesContainer=document.createElement("div"),this._sharesContainer.classList.add("jp-ManageSharesBody-selected-users"),e.appendChild(this._sharesContainer);const s=document.createElement("input");s.classList.add("jp-ManageSharesBody-url-input"),s.readOnly=!0,s.value=this._url,e.appendChild(s),e.insertAdjacentHTML("beforeend","<br>"),e.insertAdjacentText("beforeend",this._trans.__("Warning: Anyone you share this server with will have access to all your files, not just the currently open file.")),e.insertAdjacentHTML("beforeend","<br>"),e.insertAdjacentText("beforeend",this._trans.__("If your Hub administrator allows it, you can create another server dedicated to sharing a specific project."))}_updateSearchResults(){var e;if(!this._searchResults)return;this._searchResults.innerHTML="";const t=(null===(e=this._searchInput)||void 0===e?void 0:e.value)||"";this._recipients.filter((e=>e.name.toLowerCase().includes(t.toLowerCase())||""===t)).forEach((e=>{var t;const s=document.createElement("div");s.classList.add("jp-ManageSharesBody-user-item"),"group"===e.type?s.textContent=this._trans.__("Group %1",e.name):s.textContent=e.name,s.addEventListener("click",(async()=>{await this._createShare(e,e.type),await this._loadShares(),await this._updateSharesList();const t=new Set(this._shares.map((e=>e.name)));this._recipients=this._recipients.filter((e=>e.name!==this._serverOwner&&!t.has(e.name))),this._updateSearchResults()})),null===(t=this._searchResults)||void 0===t||t.appendChild(s)}))}async _updateSharesList(){if(!this._sharesContainer)return;this._sharesContainer.innerHTML="";const e=document.createElement("table");e.classList.add("jp-ManageSharesBody-shares-table");const t=document.createElement("tr"),s=document.createElement("th");s.textContent=this._trans.__("Shared with");const n=document.createElement("th");n.textContent=this._trans.__("Shared since");const r=document.createElement("th");if(r.textContent=this._trans.__("Actions"),t.appendChild(s),t.appendChild(n),t.appendChild(r),e.appendChild(t),0===this._shares.length){const t=document.createElement("tr"),s=document.createElement("td");s.colSpan=3,s.textContent=this._trans.__("Your server is not shared to anybody yet. You can search for users and groups above."),t.appendChild(s),e.appendChild(t)}else this._shares.forEach((t=>{const s=document.createElement("tr"),n=document.createElement("td");"group"===t.type?n.textContent=this._trans.__("Group %1",t.name):n.textContent=t.name,s.appendChild(n);const r=document.createElement("td"),a=new Date(t.createdAt).toLocaleString([],{hour:"2-digit",minute:"2-digit",year:"numeric",month:"2-digit",day:"2-digit"});r.textContent=a,s.appendChild(r);const o=document.createElement("td"),i=document.createElement("button");i.textContent=this._trans.__("Revoke"),i.classList.add("jp-mod-styled"),i.addEventListener("click",(async()=>{await this._deleteShare(t,t.type),await this._loadShares(),await this._updateSharesList(),await this._loadUsers();const e=new Set(this._shares.map((e=>e.name)));this._recipients=this._recipients.filter((t=>t.name!==this._serverOwner&&!e.has(t.name))),this._updateSearchResults()})),o.appendChild(i),s.appendChild(o),e.appendChild(s)}));this._sharesContainer.appendChild(e)}}class F extends l.Widget{constructor(e,t,s,n){super(),this._url=e,this._token=t,this._behindHub=s,this._trans=n,this._tokenCheckbox=null,this._onTokenChange=e=>{const t=e.target;this._updateContent(null==t?void 0:t.checked)},this._warning=document.createElement("div"),this._populateBody(this.node),this.addClass("jp-shared-link-body")}getValue(){var e;if(!0===(null===(e=this._tokenCheckbox)||void 0===e?void 0:e.checked)){const e=new URL(this._url);return e.searchParams.set("token",this._token),e.toString()}return this._url}onAfterAttach(e){var t;super.onAfterAttach(e),null===(t=this._tokenCheckbox)||void 0===t||t.addEventListener("change",this._onTokenChange)}onBeforeDetach(e){var t;null===(t=this._tokenCheckbox)||void 0===t||t.removeEventListener("change",this._onTokenChange),super.onBeforeDetach(e)}_updateContent(e){this._warning.innerHTML="";const t=this.node.querySelector("input[readonly]");if(e){if(t){const e=new URL(this._url);e.searchParams.set("token",this._token.slice(0,5)),t.value=e.toString()+"…"}this._warning.appendChild(document.createElement("h3")).textContent=this._trans.__("Security warning!"),this._warning.insertAdjacentText("beforeend",this._trans.__("Anyone with this link has full access to your notebook server, including all your files!")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._warning.insertAdjacentText("beforeend",this._trans.__("Please be careful who you share it with.")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._behindHub?(this._warning.insertAdjacentText("beforeend",this._trans.__("They will be able to access this server AS YOU.")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._warning.insertAdjacentText("beforeend",this._trans.__("To revoke access, go to File -> Hub Control Panel, and restart your server."))):this._warning.insertAdjacentText("beforeend",this._trans.__("Currently, there is no way to revoke access other than shutting down your server."))}else t&&(t.value=this._url),this._behindHub?this._warning.insertAdjacentText("beforeend",this._trans.__("Only users with `access:servers` permissions for this server will be able to use this link.")):this._warning.insertAdjacentText("beforeend",this._trans.__("Only authenticated users will be able to use this link."))}_populateBody(e){const t=document.createElement("input");if(t.readOnly=!0,t.value=this._url,e.appendChild(t),this._token){const t=e.appendChild(document.createElement("label"));t.insertAdjacentHTML("beforeend",'<input type="checkbox">'),this._tokenCheckbox=t.firstChild,t.insertAdjacentText("beforeend",this._trans.__("Include token in URL")),e.insertAdjacentElement("beforeend",this._warning),this._updateContent(!1)}}}var H=s(1269);function W(e){const{userManager:t,onClick:s}=e,[n,r]=(0,c.useState)(t.identity);return(0,c.useEffect)((()=>{const e=()=>{r(t.identity)};return t.userChanged.connect(e),()=>{t.userChanged.disconnect(e)}}),[t]),d().createElement("div",{title:n.display_name,className:"jp-UserInfo-Icon",style:{backgroundColor:n.color},onClick:s},d().createElement("span",null,n.initials))}class J extends o.ReactWidget{constructor(e){super(),this._onChange=(e,t)=>{var s;const n=(null===(s=this._userManager.permissions)||void 0===s?void 0:s.updatable_fields)||[];(null==n?void 0:n.includes(t))&&(this._userUpdate[t]=e.target.value)},this._userUpdate={},this._userManager=e.userManager}getValue(){return this._userUpdate}render(){var e;const t=this._userManager.identity;if(!t)return d().createElement("div",{className:"jp-UserInfo-Details"},"Error loading user info");const s=(null===(e=this._userManager.permissions)||void 0===e?void 0:e.updatable_fields)||[];return d().createElement("div",{className:"jp-UserInfo-Details"},Object.keys(t).map((e=>{const n=`jp-UserInfo-Value-${e}`;return d().createElement("div",{key:e,className:"jp-UserInfo-Field"},d().createElement("label",{htmlFor:n},e),d().createElement("input",{type:"text",name:e,id:n,onInput:t=>this._onChange(t,e),defaultValue:t[e],disabled:!(null==s?void 0:s.includes(e))}))})))}}class z extends l.Panel{constructor(e){super({}),this.addClass("jp-UserInfoPanel"),this._profile=e.userManager,this._body=null,this._profile.isReady?(this._body=new V({userManager:this._profile,trans:e.trans}),this.addWidget(this._body),this.update()):this._profile.ready.then((()=>{this._body=new V({userManager:this._profile,trans:e.trans}),this.addWidget(this._body),this.update()})).catch((e=>console.error(e)))}}class V extends a.ReactWidget{constructor(e){super(),this.onClick=()=>{this._userManager.identity&&(0,a.showDialog)({body:new J({userManager:this._userManager}),title:this._trans.__("User Details")}).then((async e=>{if(e.button.accept)try{const t=H.ServerConnection.makeSettings(),s=T.URLExt.join(t.baseUrl,"/api/me"),n={method:"PATCH",body:JSON.stringify(e.value)};let r;try{r=await H.ServerConnection.makeRequest(s,n,t)}catch(e){throw new H.ServerConnection.NetworkError(e)}if(!r.ok){const e=this._trans.__("Failed to update user data");throw new Error(e)}this._userManager.refreshUser()}catch(e){console.error(e)}}))},this._userManager=e.userManager,this._trans=e.trans}get user(){return this._userManager}set user(e){this._userManager=e,this.update()}render(){return c.createElement("div",{className:"jp-UserInfo-Container"},c.createElement(W,{userManager:this._userManager,onClick:this.onClick}))}}class q extends c.Component{constructor(e){var t;super(e),this._awarenessChange=()=>{var e;const t=null===(e=this._model)||void 0===e?void 0:e.sharedModel.awareness.getStates(),s=[];t&&t.forEach(((e,t)=>{e.user&&s.push({userId:t,userData:e.user})})),this.setState((e=>({...e,usersList:s})))},this._model=e.model,this._iconRenderer=null!==(t=e.iconRenderer)&&void 0!==t?t:null,this.state={usersList:[]}}static createWidget(e){return o.ReactWidget.create(c.createElement(q,{...e}))}componentDidMount(){var e;null===(e=this._model)||void 0===e||e.sharedModel.awareness.on("change",this._awarenessChange),this._awarenessChange()}filterDuplicated(e){var t;const s=[],n=new Set;for(const r of e)(null===(t=null==r?void 0:r.userData)||void 0===t?void 0:t.username)&&!n.has(r.userData.username)&&(n.add(r.userData.username),s.push(r));return s}render(){var e;const t=null!==(e=this._iconRenderer)&&void 0!==e?e:G;return c.createElement("div",{className:"jp-toolbar-users-item"},this.filterDuplicated(this.state.usersList).map((e=>{if(this._model&&e.userId!==this._model.sharedModel.awareness.clientID)return t({user:e,model:this._model})})))}}function G(e){let t;const{user:s,model:n,...r}=e,a=(0,o.classes)("lm-MenuBar-itemIcon",e.className||"");return t=s.userData.avatar_url?c.createElement("div",{...r,key:s.userId,title:s.userData.display_name,className:(0,o.classes)(a,"jp-MenuBar-imageIcon")},c.createElement("img",{src:s.userData.avatar_url,alt:""})):c.createElement("div",{...r,key:s.userId,title:s.userData.display_name,className:(0,o.classes)(a,"jp-MenuBar-anonymousIcon"),style:{backgroundColor:s.userData.color}},c.createElement("span",null,s.userData.initials)),t}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[842],{4842:(e,r,a)=>{a.r(r),a.d(r,{default:()=>I});var o=a(9715),t=a(8118),n=a(5818),s=a(2470),i=a(9159),l=a(2310),c=a(1269),d=a(389),u=a(1593),p=a(5256),m=a(3398),b=a(2206),y=a(7784);const w={id:"@jupyter/collaboration-extension:userMenu",description:"Provide connected user menu.",requires:[],provides:m.IUserMenu,activate:e=>{const{commands:r}=e,{user:a}=e.serviceManager;return new m.UserMenu({commands:r,user:a})}},v={id:"@jupyter/collaboration-extension:user-menu-bar",description:"Add user menu to the interface.",autoStart:!0,requires:[m.IUserMenu,o.IToolbarWidgetRegistry],activate:async(e,r,a)=>{const{user:o}=e.serviceManager,t=new p.MenuBar({forceItemsPosition:{forceX:!1,forceY:!1},renderer:new m.RendererUserMenu(o)});t.id="jp-UserMenu",o.userChanged.connect((()=>t.update())),t.addMenu(r),a.addFactory("TopBar","user-menu",(()=>t))}},g={id:"@jupyter/collaboration-extension:rtcGlobalAwareness",description:"Add global awareness to share working document of users.",requires:[d.IStateDB],provides:n.IGlobalAwareness,activate:(e,r)=>{const{user:a}=e.serviceManager,o=new b.Doc,t=new y.ww(o),n=c.ServerConnection.makeSettings(),i=l.URLExt.join(n.wsUrl,"api/collaboration/room");return new s.WebSocketAwarenessProvider({url:i,roomID:"JupyterLab:globalAwareness",awareness:t,user:a}),r.changed.connect((async()=>{var e,a;const o=(null===(a=null===(e=(await r.toJSON())["layout-restorer:data"])||void 0===e?void 0:e.main)||void 0===a?void 0:a.current)||"";o.match(/^\w+:.+/)?t.setLocalStateField("current",o):t.setLocalStateField("current",null)})),t}},h={id:"@jupyter/collaboration-extension:rtcPanel",description:"Add side panel to display all currently connected users.",autoStart:!0,requires:[n.IGlobalAwareness],optional:[u.ITranslator],activate:(e,r,a)=>{const{user:o}=e.serviceManager,t=(null!=a?a:u.nullTranslator).load("jupyter_collaboration"),n=new i.SidePanel({alignment:"justify"});n.id="jp-collaboration-panel",n.title.icon=i.usersIcon,n.title.caption=t.__("Collaboration"),n.addClass("jp-RTCPanel"),e.shell.add(n,"left",{rank:300});const s=new m.UserInfoPanel({userManager:o,trans:t});s.title.label=t.__("User info"),s.title.caption=t.__("User information"),n.addWidget(s);const l=new m.CollaboratorsPanel(o,r,(r=>{e.commands.execute("docmanager:open",{path:r})}),e.docRegistry);l.title.label=t.__("Online Collaborators"),n.addWidget(l)}},_={id:"@jupyter/collaboration-extension:userEditorCursors",description:"Add CodeMirror extension to display remote user cursors and selections.",autoStart:!0,requires:[t.IEditorExtensionRegistry],activate:(e,r)=>{r.addExtension({name:"remote-user-cursors",factory(e){const{awareness:r,ysource:a}=e.model.sharedModel;return t.EditorExtensionRegistry.createImmutableExtension((0,m.remoteUserCursors)({awareness:r,ytext:a}))}})}};var x;!function(e){e.share="collaboration:shared-link"}(x||(x={}));const I=[w,v,g,h,{id:"@jupyter/collaboration-extension:shared-link",autoStart:!0,optional:[o.ICommandPalette,u.ITranslator],activate:async(e,r,a)=>{const{commands:t}=e,n=(null!=a?a:u.nullTranslator).load("jupyter_collaboration");t.addCommand(x.share,{label:n.__("Generate a Shared Link"),icon:i.shareIcon,execute:async()=>{const e=await(0,m.showSharedLinkDialog)({translator:a});e.button.accept&&e.value&&o.Clipboard.copyToSystem(e.value)}}),r&&r.addItem({command:x.share,category:n.__("Server")})}},_]}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _JUPYTERLAB;(()=>{"use strict";var e,r,t,o,a,n,i,l,u,s,f,d,c,p,h,v,b,m,y,g,j,w,P,S={1998:(e,r,t)=>{var o={"./index":()=>Promise.all([t.e(422),t.e(784),t.e(206),t.e(256),t.e(875),t.e(465),t.e(842)]).then((()=>()=>t(4842))),"./extension":()=>Promise.all([t.e(422),t.e(784),t.e(206),t.e(256),t.e(875),t.e(465),t.e(842)]).then((()=>()=>t(4842))),"./style":()=>t.e(944).then((()=>()=>t(5944)))},a=(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),n=(e,r)=>{if(t.S){var o="default",a=t.S[o];if(a&&a!==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:()=>a,init:()=>n})}},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:"d74f5ebc87b54f36fd16",393:"5888b34eeb8b3edd043e",422:"c33fd4bf2f8b13b1f430",444:"d6f3cc1c6d4b374efa63",784:"586f70cab201cb43c954",842:"9e0e516fb674a459fa5b",944:"27191c0195c19b79d6b0",952:"8934cdeb03f9bd1e666f"}[e]+".js?v="+{240:"d74f5ebc87b54f36fd16",393:"5888b34eeb8b3edd043e",422:"c33fd4bf2f8b13b1f430",444:"d6f3cc1c6d4b374efa63",784:"586f70cab201cb43c954",842:"9e0e516fb674a459fa5b",944:"27191c0195c19b79d6b0",952:"8934cdeb03f9bd1e666f"}[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/collaboration-extension:",x.l=(t,o,a,n)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName("script"),s=0;s<u.length;s++){var f=u[s];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+a){i=f;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+a),i.src=t),e[t]=[o];var d=(r,o)=>{i.onerror=i.onload=null,clearTimeout(c);var a=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((e=>e(o))),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.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 a=r[t];if(a||(a=r[t]={}),!(o.indexOf(a)>=0)){if(o.push(a),e[t])return e[t];x.o(x.S,t)||(x.S[t]={});var n=x.S[t],i="@jupyter/collaboration-extension",l=(e,r,t,o)=>{var a=n[e]=n[e]||{},l=a[r];(!l||!l.loaded&&(!o!=!l.eager?o:i>l.from))&&(a[r]={get:t,from:i,eager:!!o})},u=[];return"default"===t&&(l("@jupyter/collaboration-extension","4.1.1",(()=>Promise.all([x.e(422),x.e(784),x.e(206),x.e(256),x.e(875),x.e(465),x.e(842)]).then((()=>()=>x(4842))))),l("@jupyter/collaboration","4.1.1",(()=>Promise.all([x.e(206),x.e(262),x.e(256),x.e(312),x.e(875),x.e(393)]).then((()=>()=>x(6393))))),l("@jupyter/collaborative-drive","4.1.1",(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),l("@jupyter/docprovider","4.1.1",(()=>Promise.all([x.e(422),x.e(262),x.e(256),x.e(312),x.e(240)]).then((()=>()=>x(6240))))),l("y-websocket","1.5.4",(()=>Promise.all([x.e(422),x.e(784),x.e(952),x.e(206)]).then((()=>()=>x(2952)))))),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 a=e[o],n=(typeof a)[0];if(o>=r.length)return"u"==n;var i=r[o],l=(typeof i)[0];if(n!=l)return"o"==n&&"n"==l||"s"==l||"u"==n;if("o"!=n&&"u"!=n&&a!=i)return a<i;o++}},a=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,n=1;n<e.length;n++)o--,t+="u"==(typeof(l=e[n]))[0]?"-":(o>0?".":"")+(o=2,l);return t}var i=[];for(n=1;n<e.length;n++){var l=e[n];i.push(0===l?"not("+u()+")":1===l?"("+u()+" || "+u()+")":2===l?i.pop()+" "+i.pop():a(l))}return u();function u(){return i.pop().replace(/^\((.+)\)$/,"$1")}},n=(e,r)=>{if(0 in e){r=t(r);var o=e[0],a=o<0;a&&(o=-o-1);for(var i=0,l=1,u=!0;;l++,i++){var s,f,d=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(f=(typeof(s=r[i]))[0]))return!u||("u"==d?l>o&&!a:""==d!=a);if("u"==f){if(!u||"u"!=d)return!1}else if(u)if(d==f)if(l<=o){if(s!=e[l])return!1}else{if(a?s>e[l]:s<e[l])return!1;s!=e[l]&&(u=!1)}else if("s"!=d&&"n"!=d){if(a||l<=o)return!1;u=!1,l--}else{if(l<=o||f<d!=a)return!1;u=!1}else"s"!=d&&"n"!=d&&(u=!1,l--)}}var c=[],p=c.pop.bind(c);for(i=1;i<e.length;i++){var h=e[i];c.push(1==h?p()|p():2==h?p()&p():h?n(h,r):!p())}return!!p()},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,a)=>{var i=a?u(e[r]):e[r];return(r=Object.keys(i).reduce(((e,r)=>!n(t,r)||e&&!o(e,r)?e:r),0))&&i[r]},f=(e,r,t)=>{var a=t?u(e[r]):e[r];return Object.keys(a).reduce(((e,r)=>!e||!a[e].loaded&&o(e,r)?r:e),0)},d=(e,r,t,o)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+a(o)+")",c=(e,r,t,o,n)=>{var i=e[t];return"No satisfying version ("+a(o)+")"+(n?" 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(", ")},p=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},b=(e,r,t)=>t?t():((e,r)=>p("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),m=(v=e=>function(r,t,o,a,n){var i=x.I(r);return i&&i.then&&!o?i.then(e.bind(e,r,x.S[r],t,!1,a,n)):e(r,x.S[r],t,o,a,n)})(((e,r,t,o,a,n)=>{if(!i(r,t))return b(e,t,n);var u=s(r,t,a,o);return u?l(u):n?n():void p(c(r,e,t,a,o))})),y=v(((e,r,t,o,a,u)=>{if(!i(r,t))return b(e,t,u);var s=f(r,t,o);return n(a,s)||h(d(r,t,s,a)),l(r[t][s])})),g={},j={2206:()=>y("default","yjs",!1,[1,13,5,40]),1269:()=>y("default","@jupyterlab/services",!1,[1,7,4,6]),1593:()=>y("default","@jupyterlab/translation",!1,[1,4,4,6]),2310:()=>y("default","@jupyterlab/coreutils",!1,[1,6,4,6]),9159:()=>y("default","@jupyterlab/ui-components",!1,[1,4,4,6]),9715:()=>y("default","@jupyterlab/apputils",!1,[1,4,5,6]),5256:()=>y("default","@lumino/widgets",!1,[1,2,3,1,,"alpha",0]),389:()=>y("default","@jupyterlab/statedb",!1,[1,4,4,6]),2470:()=>y("default","@jupyter/docprovider",!1,[1,4,1,1],(()=>Promise.all([x.e(262),x.e(312),x.e(240)]).then((()=>()=>x(6240))))),3398:()=>y("default","@jupyter/collaboration",!1,[1,4,1,1],(()=>Promise.all([x.e(262),x.e(312),x.e(393)]).then((()=>()=>x(6393))))),5818:()=>y("default","@jupyter/collaborative-drive",!1,[1,4,1,1],(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),8118:()=>y("default","@jupyterlab/codemirror",!1,[1,4,4,6]),7262:()=>y("default","@lumino/coreutils",!1,[1,2,0,0]),3345:()=>y("default","react",!1,[1,18,2,0]),4602:()=>y("default","@lumino/signaling",!1,[1,2,0,0]),195:()=>y("default","@codemirror/state",!1,[1,6,2,0]),4873:()=>y("default","@lumino/virtualdom",!1,[1,2,0,0]),5024:()=>y("default","@codemirror/view",!1,[1,6,9,6]),3560:()=>m("default","y-websocket",!1,[1,1,3,15],(()=>Promise.all([x.e(784),x.e(952),x.e(206)]).then((()=>()=>x(2952)))))},w={206:[2206],240:[3560],256:[1269,1593,2310,9159,9715],262:[7262],312:[3345,4602],393:[195,4873,5024],465:[389,2470,3398,5818,8118],875:[5256]},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 a=j[e]();a.then?r.push(g[e]=a.then(t).catch(o)):t(a)}catch(e){o(e)}}}))},(()=>{var e={270: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(/^(2(06|56|62)|312|465|875)$/.test(r))e[r]=0;else{var a=new Promise(((t,a)=>o=e[r]=[t,a]));t.push(o[2]=a);var n=x.p+x.u(r),i=new Error;x.l(n,(t=>{if(x.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+n+")",i.name="ChunkLoadError",i.type=a,i.request=n,o[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,a,[n,i,l]=t,u=0;if(n.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<n.length;u++)a=n[u],x.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),x.nc=void 0;var E=x(1998);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["@jupyter/collaboration-extension"]=E})();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/collaboration/src/menu.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/src/tokens.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jupyter_collaboration_ui-2.1.1 → jupyter_collaboration_ui-2.1.2}/packages/docprovider/tsconfig.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|