jupyter-docprovider 2.1.2__py3-none-any.whl → 2.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jupyter_docprovider/_version.py +1 -1
- {jupyter_docprovider-2.1.2.data → jupyter_docprovider-2.2.0.data}/data/share/jupyter/labextensions/@jupyter/docprovider-extension/package.json +14 -14
- jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/240.1810b1e246bd604b51b2.js → jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/240.d0fe2fe7cb8c5a435ea6.js +1 -1
- jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/703.fc6d6f01a03c68359223.js +1 -0
- jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/remoteEntry.00d6cee65f8f8434f757.js → jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/remoteEntry.3d49e489848534ec8186.js +1 -1
- {jupyter_docprovider-2.1.2.data → jupyter_docprovider-2.2.0.data}/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/third-party-licenses.json +3 -3
- {jupyter_docprovider-2.1.2.dist-info → jupyter_docprovider-2.2.0.dist-info}/METADATA +1 -1
- jupyter_docprovider-2.2.0.dist-info/RECORD +17 -0
- {jupyter_docprovider-2.1.2.dist-info → jupyter_docprovider-2.2.0.dist-info}/WHEEL +1 -1
- jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/703.a9b23bb2dcc109b62003.js +0 -1
- jupyter_docprovider-2.1.2.dist-info/RECORD +0 -17
- {jupyter_docprovider-2.1.2.data → jupyter_docprovider-2.2.0.data}/data/share/jupyter/labextensions/@jupyter/docprovider-extension/install.json +0 -0
- {jupyter_docprovider-2.1.2.data → jupyter_docprovider-2.2.0.data}/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/422.3ab44960b241aac9f303.js +0 -0
- {jupyter_docprovider-2.1.2.data → jupyter_docprovider-2.2.0.data}/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/444.13de0fd44849e3f7d780.js +0 -0
- {jupyter_docprovider-2.1.2.data → jupyter_docprovider-2.2.0.data}/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/944.eaec77f5cee3f07c3b7f.js +0 -0
- {jupyter_docprovider-2.1.2.data → jupyter_docprovider-2.2.0.data}/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/994.bc087314bdabeecb0923.js +0 -0
- {jupyter_docprovider-2.1.2.data → jupyter_docprovider-2.2.0.data}/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/style.js +0 -0
- {jupyter_docprovider-2.1.2.dist-info → jupyter_docprovider-2.2.0.dist-info}/licenses/LICENSE +0 -0
jupyter_docprovider/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2.
|
|
1
|
+
__version__ = "2.2.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/docprovider-extension",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "JupyterLab - Collaborative Shared Models",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,25 +53,25 @@
|
|
|
53
53
|
"watch:labextension": "jupyter labextension watch ."
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jupyter/collaborative-drive": "^4.
|
|
57
|
-
"@jupyter/docprovider": "^4.
|
|
56
|
+
"@jupyter/collaborative-drive": "^4.2.0",
|
|
57
|
+
"@jupyter/docprovider": "^4.2.0",
|
|
58
58
|
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
|
|
59
|
-
"@jupyterlab/application": "^4.
|
|
60
|
-
"@jupyterlab/apputils": "^4.
|
|
61
|
-
"@jupyterlab/docregistry": "^4.
|
|
62
|
-
"@jupyterlab/filebrowser": "^4.
|
|
63
|
-
"@jupyterlab/fileeditor": "^4.
|
|
64
|
-
"@jupyterlab/logconsole": "^4.
|
|
65
|
-
"@jupyterlab/notebook": "^4.
|
|
66
|
-
"@jupyterlab/settingregistry": "^4.
|
|
67
|
-
"@jupyterlab/translation": "^4.
|
|
59
|
+
"@jupyterlab/application": "^4.5.0",
|
|
60
|
+
"@jupyterlab/apputils": "^4.5.0",
|
|
61
|
+
"@jupyterlab/docregistry": "^4.5.0",
|
|
62
|
+
"@jupyterlab/filebrowser": "^4.5.0",
|
|
63
|
+
"@jupyterlab/fileeditor": "^4.5.0",
|
|
64
|
+
"@jupyterlab/logconsole": "^4.5.0",
|
|
65
|
+
"@jupyterlab/notebook": "^4.5.0",
|
|
66
|
+
"@jupyterlab/settingregistry": "^4.5.0",
|
|
67
|
+
"@jupyterlab/translation": "^4.5.0",
|
|
68
68
|
"@lumino/commands": "^2.3.2",
|
|
69
69
|
"y-protocols": "^1.0.5",
|
|
70
70
|
"y-websocket": "^1.3.15",
|
|
71
71
|
"yjs": "^13.5.40"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@jupyterlab/builder": "^4.
|
|
74
|
+
"@jupyterlab/builder": "^4.5.0",
|
|
75
75
|
"@types/react": "~18.3.1",
|
|
76
76
|
"npm-run-all": "^4.1.5",
|
|
77
77
|
"rimraf": "^4.1.2",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
"_build": {
|
|
131
|
-
"load": "static/remoteEntry.
|
|
131
|
+
"load": "static/remoteEntry.3d49e489848534ec8186.js",
|
|
132
132
|
"extension": "./extension",
|
|
133
133
|
"style": "./style"
|
|
134
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[240],{68:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(758),r=n.n(o),s=n(935),i=n.n(s)()(r());i.push([e.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-timelineSliderWrapper .jp-sliderContainer{\n display: flex;\n align-items: center;\n}\n\n.jp-Slider {\n height: 4.5px\n}\n\n#jp-slider-status-bar {\n display: flex;\n}\n\n.jp-timestampDisplay {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n}\n\n.jp-restoreBtnContainer {\n width: 192px;\n}\n\n.jp-ToolbarButtonComponent.jp-restoreBtn {\n cursor: pointer;\n color: var(--jp-layout-color2);\n width: 100%;\n background: var(--jp-accept-color-normal)\n}\n",""]);const a=i},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);o&&i[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},758:e=>{e.exports=function(e){return e[1]}},591:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var s={},i=[],a=0;a<e.length;a++){var c=e[a],l=o.base?c[0]+o.base:c[0],d=s[l]||0,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}}},128:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},51:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},740:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},656:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},240:(e,t,n)=>{n.r(t),n.d(t,{ForkManager:()=>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(179);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(986),i=n(297),a=n(860),c=n(424);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(262),_=n(602);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(721),k=n(214);const b="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=k.xv();k.zd(n,2),k.Qj(n,"save"),k.zd(n,s);const r=k.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=!b,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(345),x=n.n(E),R=n(591),U=n.n(R),$=n(740),P=n.n($),D=n(128),j=n.n(D),N=n(855),L=n.n(N),F=n(51),I=n.n(F),M=n(656),A=n.n(M),O=n(68),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(694);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)}}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[240],{68:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(758),r=n.n(o),s=n(935),i=n.n(s)()(r());i.push([e.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-timelineSliderWrapper .jp-sliderContainer{\n display: flex;\n align-items: center;\n}\n\n.jp-Slider {\n height: 4.5px\n}\n\n#jp-slider-status-bar {\n display: flex;\n}\n\n.jp-timestampDisplay {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n}\n\n.jp-restoreBtnContainer {\n width: 192px;\n}\n\n.jp-ToolbarButtonComponent.jp-restoreBtn {\n cursor: pointer;\n color: var(--jp-layout-color2);\n width: 100%;\n background: var(--jp-accept-color-normal)\n}\n",""]);const a=i},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);o&&i[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},758:e=>{e.exports=function(e){return e[1]}},591:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var s={},i=[],a=0;a<e.length;a++){var c=e[a],l=o.base?c[0]+o.base:c[0],d=s[l]||0,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}}},128:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},51:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},740:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},656:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},240:(e,t,n)=>{n.r(t),n.d(t,{ForkManager:()=>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(560);class r extends o.WebsocketProvider{constructor(e){super(e.url,e.roomID,e.awareness.doc,{awareness:e.awareness}),this._isDisposed=!1,this._awareness=e.awareness,this._user=e.user,this._user.ready.then((()=>this._onUserChanged(this._user))).catch((e=>console.error(e))),this._user.userChanged.connect(this._onUserChanged,this)}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._user.userChanged.disconnect(this._onUserChanged,this),this._isDisposed=!0,this.destroy())}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}var s=n(324),i=n(603),a=n(596),c=n(248);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(262),_=n(602);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(721),k=n(214);const b="true"===i.PageConfig.getOption("disableRTC");class C{constructor(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._currentDrive=e.currentDrive,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([this._currentDrive.get(e,{...t,content:!1,contentProviderId:void 0}),o.ready]);return{...n,format:t.format}}}return this._currentDrive.get(e,{...t,contentProviderId:void 0})}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=k.xv();k.zd(n,2),k.Qj(n,"save"),k.zd(n,s);const r=k.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 this._currentDrive.save(e,{...t,contentProviderId:void 0})}get fileChanged(){return this._providerFileChanged}}class T{constructor(e){this._onCreate=e,this.collaborative=!b,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(345),x=n.n(E),R=n(591),U=n.n(R),$=n(740),D=n.n($),P=n(128),j=n.n(P),N=n(855),L=n.n(N),I=n(51),F=n.n(I),M=n(656),A=n.n(M),O=n(68),W={};W.styleTagTransform=A(),W.setAttributes=L(),W.insert=j().bind(null,"head"),W.domAPI=D(),W.insertStyleElement=F(),U()(O.A,W),O.A&&O.A.locals&&O.A.locals;var J=n(882);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_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[703],{703:(e,t,o)=>{o.r(t),o.d(t,{default:()=>C});var r=o(324),n=o(247),i=o(956),a=o(256),s=o(812),l=o(766),d=o(816),c=o(248),u=o(0),v=o(404),g=o(484),p=o(603);const h="api/collaboration/timeline",y="The file %1 has been opened with two different views. This is not supported. Please close this view; otherwise, some of your edits may not be saved properly.",b={id:"@jupyter/docprovider-extension:content-provider",description:"The RTC content provider",provides:v.ICollaborativeContentProvider,requires:[c.ITranslator],optional:[v.IGlobalAwareness,d.ISettingRegistry],activate:async(e,t,o,r)=>{const n=t.load("jupyter_collaboration"),i=e.serviceManager.contents.defaultDrive;if(!i)throw Error("Cannot initialize content provider: default drive property not accessible on contents manager instance.");const a=i.contentProviderRegistry;if(!a)throw Error("Cannot initialize content provider: no content provider registry.");const s=r?await r.load("@jupyterlab/docmanager-extension:plugin"):null,l=new g.RtcContentProvider({currentDrive:i,serverSettings:i.serverSettings,user:e.serviceManager.user,trans:n,globalAwareness:o,docmanagerSettings:s,fileChanged:i.fileChanged});return a.register("rtc",l),l}},m={id:"@jupyter/docprovider-extension:yfile",description:"Plugin to register the shared model factory for the content type 'file'",autoStart:!0,requires:[v.ICollaborativeContentProvider,a.IEditorWidgetFactory],activate:(e,t,o)=>{t.sharedModelFactory.registerDocumentFactory("file",(()=>new u.YFile)),o.contentProviderId="rtc"}},f={id:"@jupyter/docprovider-extension:ynotebook",description:"Plugin to register the shared model factory for the content type 'notebook'",autoStart:!0,requires:[v.ICollaborativeContentProvider,l.INotebookWidgetFactory],optional:[d.ISettingRegistry],activate:(e,t,o,r)=>{let n=!0;r&&r.load("@jupyterlab/notebook-extension:tracker").then((e=>{const t=e=>{var t;const o=null==e?void 0:e.get("experimentalEnableDocumentWideUndoRedo").composite;n=null===(t=!o)||void 0===t||t};t(e),e.changed.connect((e=>t(e)))})),t.sharedModelFactory.registerDocumentFactory("notebook",(()=>new u.YNotebook({disableDocumentWideUndoRedo:n}))),o.contentProviderId="rtc"}},w={id:"@jupyter/docprovider-extension:statusBarTimeline",description:"Plugin to add a timeline slider to the status bar",autoStart:!0,requires:[i.IStatusBar,v.ICollaborativeContentProvider],activate:async(e,t,o)=>{try{let r=null,i=null;const a=async(t,r)=>{if(!r)return;i&&(i.dispose(),i=null);const[a,s]=r.split(":"),l=o.providers.get(`${a}:${s}:${t}`);if(!l)return;const d=l,c=p.URLExt.join(e.serviceManager.serverSettings.baseUrl,h,t);i=new g.TimelineWidget(c,d,d.contentType,d.format,h);const u=document.getElementById("jp-slider-status-bar");u&&!i.isAttached&&n.Widget.attach(i,u)};e.shell.currentChanged&&e.shell.currentChanged.connect((async(e,t)=>{const o=t.newValue;i&&(i.dispose(),i=null),o&&"context"in o&&(await o.context.ready,await a(o.context.path,o.context.model.sharedModel.getState("document_id")))})),t&&(r||(r=new n.Widget,r.addClass("jp-StatusBar-GroupItem"),r.addClass("jp-mod-highlighted"),r.id="jp-slider-status-bar",t.registerStatusItem("jp-slider-status-bar",{item:r,align:"left",rank:4,isActive:()=>{var t,o;const r=e.shell.currentWidget;return(null===(o=null===(t=null==r?void 0:r.context)||void 0===t?void 0:t.model)||void 0===o?void 0:o.collaborative)||!1}})))}catch(e){console.error("Failed to activate statusBarTimeline plugin:",e)}}},C=[b,m,f,{id:"@jupyter/docprovider-extension:logger",description:"A logging plugin for debugging purposes.",autoStart:!0,optional:[s.ILoggerRegistry,a.IEditorTracker,l.INotebookTracker,c.ITranslator],activate:(e,t,o,n,i)=>{const a=(null!=i?i:c.nullTranslator).load("jupyter_collaboration"),s="https://schema.jupyter.org/jupyter_collaboration/session/v1";if(!t)return void e.serviceManager.events.stream.connect(((e,t)=>{var o,n;t.schema_id===s&&(console.debug(`[${t.room}(${t.path})] ${null!==(o=t.action)&&void 0!==o?o:""}: ${null!==(n=t.msg)&&void 0!==n?n:""}`),"WARNING"===t.level&&(0,r.showDialog)({title:a.__("Warning"),body:a.__(y,t.path),buttons:[r.Dialog.okButton()]}))}));const l=new Map,d=(e,o)=>{const r=t.getLogger(o.context.path);l.set(o.context.localPath,r),o.disposed.connect((e=>{l.delete(e.context.localPath)}))};o&&o.widgetAdded.connect(d),n&&n.widgetAdded.connect(d),(async()=>{var t,o;const{events:n}=e.serviceManager;for await(const e of n.stream)if(e.schema_id===s){const n=l.get(e.path);null==n||n.log({type:"text",level:e.level.toLowerCase(),data:`[${e.room}] ${null!==(t=e.action)&&void 0!==t?t:""}: ${null!==(o=e.msg)&&void 0!==o?o:""}`}),"WARNING"===e.level&&(0,r.showDialog)({title:a.__("Warning"),body:a.__(y,e.path),buttons:[r.Dialog.warnButton({label:a.__("Ok")})]})}})()}},{id:"@jupyter/docprovider-extension:notebook-cell-executor",description:"Add notebook cell executor that uses REST API instead of kernel protocol over WebSocket.",autoStart:!0,provides:l.INotebookCellExecutor,activate:e=>"true"===p.PageConfig.getOption("serverSideExecution")?new g.NotebookCellServerExecutor({serverSettings:e.serviceManager.serverSettings}):Object.freeze({runCell:l.runCell})},w,{id:"@jupyter/docprovider-extension:forkManager",autoStart:!0,requires:[v.ICollaborativeContentProvider],provides:g.IForkManagerToken,activate:(e,t)=>{const o=e.serviceManager.events;return new g.ForkManager({contentProvider:t,eventManager:o})}}]}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _JUPYTERLAB;(()=>{"use strict";var e,r,t,o,a,n,i,l,u,d,s,f,c,p,v,h,b,y,m,g,j,w,P,S={496:(e,r,t)=>{var o={"./index":()=>Promise.all([t.e(
|
|
1
|
+
var _JUPYTERLAB;(()=>{"use strict";var e,r,t,o,a,n,i,l,u,d,s,f,c,p,v,h,b,y,m,g,j,w,P,S={496:(e,r,t)=>{var o={"./index":()=>Promise.all([t.e(575),t.e(947),t.e(703)]).then((()=>()=>t(703))),"./extension":()=>Promise.all([t.e(575),t.e(947),t.e(703)]).then((()=>()=>t(703))),"./style":()=>t.e(944).then((()=>()=>t(944)))},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:"d0fe2fe7cb8c5a435ea6",422:"3ab44960b241aac9f303",444:"13de0fd44849e3f7d780",703:"fc6d6f01a03c68359223",944:"eaec77f5cee3f07c3b7f",994:"bc087314bdabeecb0923"}[e]+".js?v="+{240:"d0fe2fe7cb8c5a435ea6",422:"3ab44960b241aac9f303",444:"13de0fd44849e3f7d780",703:"fc6d6f01a03c68359223",944:"eaec77f5cee3f07c3b7f",994:"bc087314bdabeecb0923"}[e],x.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),x.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@jupyter/docprovider-extension:",x.l=(t,o,a,n)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var s=u[d];if(s.getAttribute("src")==t||s.getAttribute("data-webpack")==r+a){i=s;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 f=(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(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),l&&document.head.appendChild(i)}},x.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{x.S={};var e={},r={};x.I=(t,o)=>{o||(o=[]);var 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/docprovider-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/collaborative-drive","4.2.0",(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),l("@jupyter/docprovider-extension","4.2.0",(()=>Promise.all([x.e(575),x.e(947),x.e(703)]).then((()=>()=>x(703))))),l("@jupyter/docprovider","4.2.0",(()=>Promise.all([x.e(422),x.e(575),x.e(262),x.e(240)]).then((()=>()=>x(240))))),l("y-websocket","1.5.4",(()=>Promise.all([x.e(422),x.e(994),x.e(206)]).then((()=>()=>x(994)))))),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 d,s,f=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(s=(typeof(d=r[i]))[0]))return!u||("u"==f?l>o&&!a:""==f!=a);if("u"==s){if(!u||"u"!=f)return!1}else if(u)if(f==s)if(l<=o){if(d!=e[l])return!1}else{if(a?d>e[l]:d<e[l])return!1;d!=e[l]&&(u=!1)}else if("s"!=f&&"n"!=f){if(a||l<=o)return!1;u=!1,l--}else{if(l<=o||s<f!=a)return!1;u=!1}else"s"!=f&&"n"!=f&&(u=!1,l--)}}var c=[],p=c.pop.bind(c);for(i=1;i<e.length;i++){var v=e[i];c.push(1==v?p()|p():2==v?p()&p():v?n(v,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)),{}),d=(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]},s=(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)},f=(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)},v=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),y=(h=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=d(r,t,a,o);return u?l(u):n?n():void p(c(r,e,t,a,o))})),m=h(((e,r,t,o,a,u)=>{if(!i(r,t))return b(e,t,u);var d=s(r,t,o);return n(a,d)||v(f(r,t,d,a)),l(r[t][d])})),g={},j={248:()=>m("default","@jupyterlab/translation",!1,[1,4,5,0]),324:()=>m("default","@jupyterlab/apputils",!1,[1,4,6,0]),603:()=>m("default","@jupyterlab/coreutils",!1,[1,6,5,0]),0:()=>m("default","@jupyter/ydoc",!1,[1,3,0,0,,"a3"]),247:()=>m("default","@lumino/widgets",!1,[1,2,3,1,,"alpha",1]),256:()=>m("default","@jupyterlab/fileeditor",!1,[1,4,5,0]),404:()=>m("default","@jupyter/collaborative-drive",!1,[1,4,2,0],(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),484:()=>m("default","@jupyter/docprovider",!1,[1,4,2,0],(()=>Promise.all([x.e(422),x.e(262),x.e(240)]).then((()=>()=>x(240))))),766:()=>m("default","@jupyterlab/notebook",!1,[1,4,5,0]),812:()=>m("default","@jupyterlab/logconsole",!1,[1,4,5,0]),816:()=>m("default","@jupyterlab/settingregistry",!1,[1,4,5,0]),956:()=>m("default","@jupyterlab/statusbar",!1,[1,4,5,0]),262:()=>m("default","@lumino/coreutils",!1,[1,2,0,0]),345:()=>m("default","react",!1,[1,18,2,0]),560:()=>y("default","y-websocket",!1,[1,1,3,15],(()=>Promise.all([x.e(994),x.e(206)]).then((()=>()=>x(994))))),596:()=>m("default","@jupyterlab/services",!1,[1,7,5,0]),602:()=>m("default","@lumino/signaling",!1,[1,2,0,0]),882:()=>m("default","@jupyterlab/ui-components",!1,[1,4,5,0]),206:()=>m("default","yjs",!1,[1,13,5,40])},w={206:[206],240:[345,560,596,602,882],262:[262],575:[248,324,603],947:[0,247,256,404,484,766,812,816,956]},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={552:0};x.f.j=(r,t)=>{var o=x.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else if(/^(206|262|575|947)$/.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_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),x.nc=void 0;var E=x(496);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["@jupyter/docprovider-extension"]=E})();
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
"packages": [
|
|
3
3
|
{
|
|
4
4
|
"name": "@jupyter/collaboration",
|
|
5
|
-
"versionInfo": "4.
|
|
5
|
+
"versionInfo": "4.2.0",
|
|
6
6
|
"licenseId": "BSD-3-Clause",
|
|
7
7
|
"extractedText": ""
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "@jupyter/collaborative-drive",
|
|
11
|
-
"versionInfo": "4.
|
|
11
|
+
"versionInfo": "4.2.0",
|
|
12
12
|
"licenseId": "BSD-3-Clause",
|
|
13
13
|
"extractedText": ""
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"name": "@jupyter/docprovider",
|
|
17
|
-
"versionInfo": "4.
|
|
17
|
+
"versionInfo": "4.2.0",
|
|
18
18
|
"licenseId": "BSD-3-Clause",
|
|
19
19
|
"extractedText": ""
|
|
20
20
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jupyter-docprovider
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: JupyterLab/Jupyter Notebook 7+ extension integrating collaborative shared models.
|
|
5
5
|
Project-URL: Documentation, https://jupyterlab-realtime-collaboration.readthedocs.io/
|
|
6
6
|
Project-URL: Repository, https://github.com/jupyterlab/jupyter-collaboration
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
jupyter_docprovider/__init__.py,sha256=pvzIgrnwXG3rAiMW5TvmGOCW0CPWIlk54yXEw_O_jrc,260
|
|
2
|
+
jupyter_docprovider/_version.py,sha256=DKk-1b-rZsJFxFi1JoJ7TmEvIEQ0rf-C9HAZWwvjuM0,22
|
|
3
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/package.json,sha256=EezPHHGxljVqiXyRzg8bSviNzPFhZTu25AzJq3DTbjk,3937
|
|
4
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/240.d0fe2fe7cb8c5a435ea6.js,sha256=0P4v58uMWkNepiJdAVU6jJrUhKsi9E4a21KhdxlT65E,21756
|
|
5
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/422.3ab44960b241aac9f303.js,sha256=OrRJYLJBqsnzA0qgMSMcR5YfnSlyg7egM2nOpzNLqw0,3243
|
|
6
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/444.13de0fd44849e3f7d780.js,sha256=E94P1EhJ4_fXgNC7xISUph3poODWDafmpcC1VjMr5jE,377
|
|
7
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/703.fc6d6f01a03c68359223.js,sha256=_G1vAaA8aDWSI6mx8W0YkBMmoaMCkrEP2kOItllVSTI,5521
|
|
8
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/944.eaec77f5cee3f07c3b7f.js,sha256=6ux39c7j8Hw7fxp2FcM2PAnNel-pf4qzELC22aCz26U,11482
|
|
9
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/994.bc087314bdabeecb0923.js,sha256=vAhzFL2r7ssJI_7W8sS9qYom3iOF0tSW1_SRh-6v3dk,13126
|
|
10
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/remoteEntry.3d49e489848534ec8186.js,sha256=PUnkiYSFNOyBhs0EgDlPtmEHHUBOfLq-Ex-EnFRHp24,9140
|
|
11
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/style.js,sha256=IIvKvBMPlm9SdCt0l2x7pOx2ZMG7tbWWhxCH8l4ylSU,173
|
|
12
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/third-party-licenses.json,sha256=cIMR8kB-JAti8sfbHaAUPbSp7MroZuGzAKhVBLgz5C4,7896
|
|
13
|
+
jupyter_docprovider-2.2.0.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/install.json,sha256=NO9HH1zbt0jedIG_-lqpMiOhO1OAvrUmoUfIjgyzvpE,199
|
|
14
|
+
jupyter_docprovider-2.2.0.dist-info/METADATA,sha256=rykkU9ZnKjJ-7CoyohX8R0D0KDgvZKEaT6IRuPQ5EKM,5073
|
|
15
|
+
jupyter_docprovider-2.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
16
|
+
jupyter_docprovider-2.2.0.dist-info/licenses/LICENSE,sha256=mhO0ZW9EiWOPg0dUgB-lNbJ0CGwRmTdbeAg_se1SOnY,2833
|
|
17
|
+
jupyter_docprovider-2.2.0.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[703],{703:(e,t,o)=>{o.r(t),o.d(t,{default:()=>C});var r=o(986),n=o(256),i=o(748),a=o(544),s=o(852),l=o(762),d=o(560),c=o(424),u=o(0),v=o(247),g=o(344),p=o(297);const h="api/collaboration/timeline",y="The file %1 has been opened with two different views. This is not supported. Please close this view; otherwise, some of your edits may not be saved properly.",b={id:"@jupyter/docprovider-extension:content-provider",description:"The RTC content provider",provides:v.ICollaborativeContentProvider,requires:[c.ITranslator],optional:[v.IGlobalAwareness,d.ISettingRegistry],activate:async(e,t,o,r)=>{const n=t.load("jupyter_collaboration"),i=e.serviceManager.contents.defaultDrive;if(!i)throw Error("Cannot initialize content provider: default drive property not accessible on contents manager instance.");const a=i.contentProviderRegistry;if(!a)throw Error("Cannot initialize content provider: no content provider registry.");const s=r?await r.load("@jupyterlab/docmanager-extension:plugin"):null,l=new g.RtcContentProvider({apiEndpoint:"/api/contents",serverSettings:i.serverSettings,user:e.serviceManager.user,trans:n,globalAwareness:o,docmanagerSettings:s,fileChanged:i.fileChanged});return a.register("rtc",l),l}},m={id:"@jupyter/docprovider-extension:yfile",description:"Plugin to register the shared model factory for the content type 'file'",autoStart:!0,requires:[v.ICollaborativeContentProvider,a.IEditorWidgetFactory],activate:(e,t,o)=>{t.sharedModelFactory.registerDocumentFactory("file",(()=>new u.YFile)),o.contentProviderId="rtc"}},f={id:"@jupyter/docprovider-extension:ynotebook",description:"Plugin to register the shared model factory for the content type 'notebook'",autoStart:!0,requires:[v.ICollaborativeContentProvider,l.INotebookWidgetFactory],optional:[d.ISettingRegistry],activate:(e,t,o,r)=>{let n=!0;r&&r.load("@jupyterlab/notebook-extension:tracker").then((e=>{const t=e=>{var t;const o=null==e?void 0:e.get("experimentalEnableDocumentWideUndoRedo").composite;n=null===(t=!o)||void 0===t||t};t(e),e.changed.connect((e=>t(e)))})),t.sharedModelFactory.registerDocumentFactory("notebook",(()=>new u.YNotebook({disableDocumentWideUndoRedo:n}))),o.contentProviderId="rtc"}},w={id:"@jupyter/docprovider-extension:statusBarTimeline",description:"Plugin to add a timeline slider to the status bar",autoStart:!0,requires:[i.IStatusBar,v.ICollaborativeContentProvider],activate:async(e,t,o)=>{try{let r=null,i=null;const a=async(t,r)=>{if(!r)return;i&&(i.dispose(),i=null);const[a,s]=r.split(":"),l=o.providers.get(`${a}:${s}:${t}`);if(!l)return;const d=l,c=p.URLExt.join(e.serviceManager.serverSettings.baseUrl,h,t);i=new g.TimelineWidget(c,d,d.contentType,d.format,h);const u=document.getElementById("jp-slider-status-bar");u&&!i.isAttached&&n.Widget.attach(i,u)};e.shell.currentChanged&&e.shell.currentChanged.connect((async(e,t)=>{const o=t.newValue;i&&(i.dispose(),i=null),o&&"context"in o&&(await o.context.ready,await a(o.context.path,o.context.model.sharedModel.getState("document_id")))})),t&&(r||(r=new n.Widget,r.addClass("jp-StatusBar-GroupItem"),r.addClass("jp-mod-highlighted"),r.id="jp-slider-status-bar",t.registerStatusItem("jp-slider-status-bar",{item:r,align:"left",rank:4,isActive:()=>{var t,o;const r=e.shell.currentWidget;return(null===(o=null===(t=null==r?void 0:r.context)||void 0===t?void 0:t.model)||void 0===o?void 0:o.collaborative)||!1}})))}catch(e){console.error("Failed to activate statusBarTimeline plugin:",e)}}},C=[b,m,f,{id:"@jupyter/docprovider-extension:logger",description:"A logging plugin for debugging purposes.",autoStart:!0,optional:[s.ILoggerRegistry,a.IEditorTracker,l.INotebookTracker,c.ITranslator],activate:(e,t,o,n,i)=>{const a=(null!=i?i:c.nullTranslator).load("jupyter_collaboration"),s="https://schema.jupyter.org/jupyter_collaboration/session/v1";if(!t)return void e.serviceManager.events.stream.connect(((e,t)=>{var o,n;t.schema_id===s&&(console.debug(`[${t.room}(${t.path})] ${null!==(o=t.action)&&void 0!==o?o:""}: ${null!==(n=t.msg)&&void 0!==n?n:""}`),"WARNING"===t.level&&(0,r.showDialog)({title:a.__("Warning"),body:a.__(y,t.path),buttons:[r.Dialog.okButton()]}))}));const l=new Map,d=(e,o)=>{const r=t.getLogger(o.context.path);l.set(o.context.localPath,r),o.disposed.connect((e=>{l.delete(e.context.localPath)}))};o&&o.widgetAdded.connect(d),n&&n.widgetAdded.connect(d),(async()=>{var t,o;const{events:n}=e.serviceManager;for await(const e of n.stream)if(e.schema_id===s){const n=l.get(e.path);null==n||n.log({type:"text",level:e.level.toLowerCase(),data:`[${e.room}] ${null!==(t=e.action)&&void 0!==t?t:""}: ${null!==(o=e.msg)&&void 0!==o?o:""}`}),"WARNING"===e.level&&(0,r.showDialog)({title:a.__("Warning"),body:a.__(y,e.path),buttons:[r.Dialog.warnButton({label:a.__("Ok")})]})}})()}},{id:"@jupyter/docprovider-extension:notebook-cell-executor",description:"Add notebook cell executor that uses REST API instead of kernel protocol over WebSocket.",autoStart:!0,provides:l.INotebookCellExecutor,activate:e=>"true"===p.PageConfig.getOption("serverSideExecution")?new g.NotebookCellServerExecutor({serverSettings:e.serviceManager.serverSettings}):Object.freeze({runCell:l.runCell})},w,{id:"@jupyter/docprovider-extension:forkManager",autoStart:!0,requires:[v.ICollaborativeContentProvider],provides:g.IForkManagerToken,activate:(e,t)=>{const o=e.serviceManager.events;return new g.ForkManager({contentProvider:t,eventManager:o})}}]}}]);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
jupyter_docprovider/__init__.py,sha256=pvzIgrnwXG3rAiMW5TvmGOCW0CPWIlk54yXEw_O_jrc,260
|
|
2
|
-
jupyter_docprovider/_version.py,sha256=UiuBcRXPtXxPUBDdp0ZDvWl0U9Db1kMNfT3oAfhxqLg,22
|
|
3
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/package.json,sha256=CFCK5KaN1gJM5dILpMDnOM1cnhta5pgWZO-T54h3ui0,3937
|
|
4
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/240.1810b1e246bd604b51b2.js,sha256=GBCx4ka9YEtRsolKYjCCYqvdpPX87fYAXEXT_8SAv1s,21637
|
|
5
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/422.3ab44960b241aac9f303.js,sha256=OrRJYLJBqsnzA0qgMSMcR5YfnSlyg7egM2nOpzNLqw0,3243
|
|
6
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/444.13de0fd44849e3f7d780.js,sha256=E94P1EhJ4_fXgNC7xISUph3poODWDafmpcC1VjMr5jE,377
|
|
7
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/703.a9b23bb2dcc109b62003.js,sha256=qbI7stzBCbYgA-1mf-3SwVOOC5BpszvrB-ONCaunDS0,5534
|
|
8
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/944.eaec77f5cee3f07c3b7f.js,sha256=6ux39c7j8Hw7fxp2FcM2PAnNel-pf4qzELC22aCz26U,11482
|
|
9
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/994.bc087314bdabeecb0923.js,sha256=vAhzFL2r7ssJI_7W8sS9qYom3iOF0tSW1_SRh-6v3dk,13126
|
|
10
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/remoteEntry.00d6cee65f8f8434f757.js,sha256=ANbO5l-PhDT3V10qMR3_Wu8Nq9rRUNGiuje4Bf2t8Fs,9150
|
|
11
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/style.js,sha256=IIvKvBMPlm9SdCt0l2x7pOx2ZMG7tbWWhxCH8l4ylSU,173
|
|
12
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/static/third-party-licenses.json,sha256=GkpOyY2sML-NaP-k_AycD7mGDtVg-x4n5sEKBonuDHQ,7896
|
|
13
|
-
jupyter_docprovider-2.1.2.data/data/share/jupyter/labextensions/@jupyter/docprovider-extension/install.json,sha256=NO9HH1zbt0jedIG_-lqpMiOhO1OAvrUmoUfIjgyzvpE,199
|
|
14
|
-
jupyter_docprovider-2.1.2.dist-info/METADATA,sha256=o0QnlVF8dioOrGJqWwwIDcuF3jiqdiCTgEF4ZjynBAA,5073
|
|
15
|
-
jupyter_docprovider-2.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
16
|
-
jupyter_docprovider-2.1.2.dist-info/licenses/LICENSE,sha256=mhO0ZW9EiWOPg0dUgB-lNbJ0CGwRmTdbeAg_se1SOnY,2833
|
|
17
|
-
jupyter_docprovider-2.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jupyter_docprovider-2.1.2.dist-info → jupyter_docprovider-2.2.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|