@jupyter/docprovider 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/TimelineSlider.d.ts +2 -1
- package/lib/TimelineSlider.js +3 -2
- package/lib/component.d.ts +1 -0
- package/lib/component.js +7 -4
- package/package.json +2 -2
package/lib/TimelineSlider.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export declare class TimelineWidget extends ReactWidget {
|
|
|
5
5
|
private provider;
|
|
6
6
|
private contentType;
|
|
7
7
|
private format;
|
|
8
|
-
|
|
8
|
+
private documentTimelineUrl;
|
|
9
|
+
constructor(apiURL: string, provider: IForkProvider, contentType: string, format: string, documentTimelineUrl: string);
|
|
9
10
|
render(): JSX.Element;
|
|
10
11
|
updateContent(apiURL: string, provider: IForkProvider): void;
|
|
11
12
|
}
|
package/lib/TimelineSlider.js
CHANGED
|
@@ -6,16 +6,17 @@ import { ReactWidget } from '@jupyterlab/apputils';
|
|
|
6
6
|
import { TimelineSliderComponent } from './component';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
export class TimelineWidget extends ReactWidget {
|
|
9
|
-
constructor(apiURL, provider, contentType, format) {
|
|
9
|
+
constructor(apiURL, provider, contentType, format, documentTimelineUrl) {
|
|
10
10
|
super();
|
|
11
11
|
this.apiURL = apiURL;
|
|
12
12
|
this.provider = provider;
|
|
13
13
|
this.contentType = contentType;
|
|
14
14
|
this.format = format;
|
|
15
|
+
this.documentTimelineUrl = documentTimelineUrl;
|
|
15
16
|
this.addClass('jp-timelineSliderWrapper');
|
|
16
17
|
}
|
|
17
18
|
render() {
|
|
18
|
-
return (React.createElement(TimelineSliderComponent, { key: this.apiURL, apiURL: this.apiURL, provider: this.provider, contentType: this.contentType, format: this.format }));
|
|
19
|
+
return (React.createElement(TimelineSliderComponent, { key: this.apiURL, apiURL: this.apiURL, provider: this.provider, contentType: this.contentType, format: this.format, documentTimelineUrl: this.documentTimelineUrl }));
|
|
19
20
|
}
|
|
20
21
|
updateContent(apiURL, provider) {
|
|
21
22
|
this.apiURL = apiURL;
|
package/lib/component.d.ts
CHANGED
package/lib/component.js
CHANGED
|
@@ -7,7 +7,7 @@ import '../style/slider.css';
|
|
|
7
7
|
import { requestUndoRedo, requestDocSession, requestDocumentTimeline } from './requests';
|
|
8
8
|
import { historyIcon } from '@jupyterlab/ui-components';
|
|
9
9
|
import { Notification } from '@jupyterlab/apputils';
|
|
10
|
-
export const TimelineSliderComponent = ({ apiURL, provider, contentType, format }) => {
|
|
10
|
+
export const TimelineSliderComponent = ({ apiURL, provider, contentType, format, documentTimelineUrl }) => {
|
|
11
11
|
const [data, setData] = useState({
|
|
12
12
|
roomId: '',
|
|
13
13
|
timestamps: [],
|
|
@@ -97,11 +97,14 @@ export const TimelineSliderComponent = ({ apiURL, provider, contentType, format
|
|
|
97
97
|
try {
|
|
98
98
|
const parsedURL = new URL(url);
|
|
99
99
|
const pathname = parsedURL.pathname;
|
|
100
|
-
const
|
|
101
|
-
|
|
100
|
+
const apiIndex = pathname.lastIndexOf(documentTimelineUrl);
|
|
101
|
+
if (apiIndex === -1) {
|
|
102
|
+
throw new Error(`API segment "${documentTimelineUrl}" not found in URL.`);
|
|
103
|
+
}
|
|
104
|
+
return pathname.slice(apiIndex + documentTimelineUrl.length);
|
|
102
105
|
}
|
|
103
106
|
catch (error) {
|
|
104
|
-
console.error('Invalid URL:', error);
|
|
107
|
+
console.error('Invalid URL or unable to extract filename:', error);
|
|
105
108
|
return '';
|
|
106
109
|
}
|
|
107
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/docprovider",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
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": "^3.0.
|
|
44
|
+
"@jupyter/collaborative-drive": "^3.0.1",
|
|
45
45
|
"@jupyter/ydoc": "^2.0.0 || ^3.0.0",
|
|
46
46
|
"@jupyterlab/apputils": "^4.2.0",
|
|
47
47
|
"@jupyterlab/cells": "^4.2.0",
|