@jupyterlab/toc 6.0.0-rc.0 → 6.0.0
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/factory.d.ts +3 -3
- package/lib/factory.js.map +1 -1
- package/lib/tokens.d.ts +2 -2
- package/lib/tokens.js.map +1 -1
- package/package.json +10 -10
- package/src/factory.ts +6 -4
- package/src/tokens.ts +5 -2
package/lib/factory.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { TableOfContents } from './tokens';
|
|
|
6
6
|
/**
|
|
7
7
|
* Abstract table of contents model factory for IDocumentWidget.
|
|
8
8
|
*/
|
|
9
|
-
export declare abstract class TableOfContentsFactory<W extends IDocumentWidget> implements TableOfContents.IFactory<W> {
|
|
9
|
+
export declare abstract class TableOfContentsFactory<W extends IDocumentWidget, H extends TableOfContents.IHeading = TableOfContents.IHeading> implements TableOfContents.IFactory<W, H> {
|
|
10
10
|
protected tracker: IWidgetTracker<W>;
|
|
11
11
|
/**
|
|
12
12
|
* Constructor
|
|
@@ -28,7 +28,7 @@ export declare abstract class TableOfContentsFactory<W extends IDocumentWidget>
|
|
|
28
28
|
* @param configuration - Table of contents configuration
|
|
29
29
|
* @returns The table of contents model
|
|
30
30
|
*/
|
|
31
|
-
createNew(widget: W, configuration?: TableOfContents.IConfig): TableOfContentsModel<
|
|
31
|
+
createNew(widget: W, configuration?: TableOfContents.IConfig): TableOfContentsModel<H, W>;
|
|
32
32
|
/**
|
|
33
33
|
* Abstract table of contents model instantiation to allow
|
|
34
34
|
* override by real implementation to customize it. The public
|
|
@@ -38,5 +38,5 @@ export declare abstract class TableOfContentsFactory<W extends IDocumentWidget>
|
|
|
38
38
|
* @param widget
|
|
39
39
|
* @param configuration
|
|
40
40
|
*/
|
|
41
|
-
protected abstract _createNew(widget: W, configuration?: TableOfContents.IConfig): TableOfContentsModel<
|
|
41
|
+
protected abstract _createNew(widget: W, configuration?: TableOfContents.IConfig): TableOfContentsModel<H, W>;
|
|
42
42
|
}
|
package/lib/factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAMjE;;;;GAIG;AACH,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B;;GAEG;AACH,MAAM,OAAgB,sBAAsB;
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAMjE;;;;GAIG;AACH,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B;;GAEG;AACH,MAAM,OAAgB,sBAAsB;IAK1C;;;;OAIG;IACH,YAAsB,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IAEpD;;;;;OAKG;IACH,YAAY,CAAC,MAAc;QACzB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YAC7B,OAAO,KAAK,CAAC;SACd;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACH,SAAS,CACP,MAAS,EACT,aAAuC;QAEvC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAErD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAE/B,MAAM,cAAc,GAAG,GAAG,EAAE;YAC1B,KAAK,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;gBAC7B,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,MAAM,CAAC,CAAC;YACnE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC;YAClC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,cAAc;YACpC,OAAO,EAAE,cAAc;SACxB,CAAC,CAAC;QACH,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAEhD,MAAM,WAAW,GAAG,GAAG,EAAE;YACvB,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACpD,CAAC,CAAC;QACF,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAEzC,OAAO,CAAC,KAAK;aACV,IAAI,CAAC,GAAG,EAAE;YACT,WAAW,EAAE,CAAC;YACd,cAAc,EAAE,CAAC;QACnB,CAAC,CAAC;aACD,KAAK,CAAC,MAAM,CAAC,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,mCAAmC,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEL,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE;YAC3B,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;YACnD,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;CAeF"}
|
package/lib/tokens.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export declare namespace TableOfContents {
|
|
|
55
55
|
/**
|
|
56
56
|
* Table of content model factory interface
|
|
57
57
|
*/
|
|
58
|
-
interface IFactory<W extends Widget = Widget> {
|
|
58
|
+
interface IFactory<W extends Widget = Widget, H extends IHeading = IHeading> {
|
|
59
59
|
/**
|
|
60
60
|
* Whether the factory can handle the widget or not.
|
|
61
61
|
*
|
|
@@ -70,7 +70,7 @@ export declare namespace TableOfContents {
|
|
|
70
70
|
* @param configuration - Table of contents configuration
|
|
71
71
|
* @returns The table of contents model
|
|
72
72
|
*/
|
|
73
|
-
createNew: (widget: W, configuration?: TableOfContents.IConfig) => IModel<
|
|
73
|
+
createNew: (widget: W, configuration?: TableOfContents.IConfig) => IModel<H>;
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Table of Contents configuration
|
package/lib/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAM3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAiC1C;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,KAAK,CAC/C,0CAA0C,EAC1C,iDAAiD,CAClD,CAAC;AAcF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,KAAK,CAC9C,yCAAyC,EACzC,yCAAyC,CAC1C,CAAC;AAEF;;GAEG;AACH,MAAM,KAAW,eAAe,
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAM3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAiC1C;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,KAAK,CAC/C,0CAA0C,EAC1C,iDAAiD,CAClD,CAAC;AAcF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,KAAK,CAC9C,yCAAyC,EACzC,yCAAyC,CAC1C,CAAC;AAEF;;GAEG;AACH,MAAM,KAAW,eAAe,CAsO/B;AAtOD,WAAiB,eAAe;IA8D9B;;OAEG;IACU,6BAAa,GAAY;QACpC,aAAa,EAAE,CAAC;QAChB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,IAAI;QACnB,iBAAiB,EAAE,KAAK;KACzB,CAAC;AA8JJ,CAAC,EAtOgB,eAAe,KAAf,eAAe,QAsO/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/toc",
|
|
3
|
-
"version": "6.0.0
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "JupyterLab - Table of Contents widget",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyterlab"
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"watch": "tsc -b --watch"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@jupyterlab/apputils": "^4.0.0
|
|
45
|
-
"@jupyterlab/coreutils": "^6.0.0
|
|
46
|
-
"@jupyterlab/docregistry": "^4.0.0
|
|
47
|
-
"@jupyterlab/observables": "^5.0.0
|
|
48
|
-
"@jupyterlab/rendermime": "^4.0.0
|
|
49
|
-
"@jupyterlab/translation": "^4.0.0
|
|
50
|
-
"@jupyterlab/ui-components": "^4.0.0
|
|
44
|
+
"@jupyterlab/apputils": "^4.0.0",
|
|
45
|
+
"@jupyterlab/coreutils": "^6.0.0",
|
|
46
|
+
"@jupyterlab/docregistry": "^4.0.0",
|
|
47
|
+
"@jupyterlab/observables": "^5.0.0",
|
|
48
|
+
"@jupyterlab/rendermime": "^4.0.0",
|
|
49
|
+
"@jupyterlab/translation": "^4.0.0",
|
|
50
|
+
"@jupyterlab/ui-components": "^4.0.0",
|
|
51
51
|
"@lumino/coreutils": "^2.1.1",
|
|
52
52
|
"@lumino/disposable": "^2.1.1",
|
|
53
53
|
"@lumino/messaging": "^2.0.0",
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
"react": "^18.2.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@jupyterlab/testing": "^4.0.0
|
|
59
|
+
"@jupyterlab/testing": "^4.0.0",
|
|
60
60
|
"@types/jest": "^29.2.0",
|
|
61
61
|
"@types/react": "^18.0.26",
|
|
62
62
|
"jest": "^29.2.0",
|
|
63
63
|
"rimraf": "~3.0.0",
|
|
64
|
-
"typedoc": "~0.24.
|
|
64
|
+
"typedoc": "~0.24.7",
|
|
65
65
|
"typescript": "~5.0.4"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
package/src/factory.ts
CHANGED
|
@@ -18,8 +18,10 @@ const RENDER_TIMEOUT = 1000;
|
|
|
18
18
|
/**
|
|
19
19
|
* Abstract table of contents model factory for IDocumentWidget.
|
|
20
20
|
*/
|
|
21
|
-
export abstract class TableOfContentsFactory<
|
|
22
|
-
|
|
21
|
+
export abstract class TableOfContentsFactory<
|
|
22
|
+
W extends IDocumentWidget,
|
|
23
|
+
H extends TableOfContents.IHeading = TableOfContents.IHeading
|
|
24
|
+
> implements TableOfContents.IFactory<W, H>
|
|
23
25
|
{
|
|
24
26
|
/**
|
|
25
27
|
* Constructor
|
|
@@ -52,7 +54,7 @@ export abstract class TableOfContentsFactory<W extends IDocumentWidget>
|
|
|
52
54
|
createNew(
|
|
53
55
|
widget: W,
|
|
54
56
|
configuration?: TableOfContents.IConfig
|
|
55
|
-
): TableOfContentsModel<
|
|
57
|
+
): TableOfContentsModel<H, W> {
|
|
56
58
|
const model = this._createNew(widget, configuration);
|
|
57
59
|
|
|
58
60
|
const context = widget.context;
|
|
@@ -102,5 +104,5 @@ export abstract class TableOfContentsFactory<W extends IDocumentWidget>
|
|
|
102
104
|
protected abstract _createNew(
|
|
103
105
|
widget: W,
|
|
104
106
|
configuration?: TableOfContents.IConfig
|
|
105
|
-
): TableOfContentsModel<
|
|
107
|
+
): TableOfContentsModel<H, W>;
|
|
106
108
|
}
|
package/src/tokens.ts
CHANGED
|
@@ -73,7 +73,10 @@ export namespace TableOfContents {
|
|
|
73
73
|
/**
|
|
74
74
|
* Table of content model factory interface
|
|
75
75
|
*/
|
|
76
|
-
export interface IFactory<
|
|
76
|
+
export interface IFactory<
|
|
77
|
+
W extends Widget = Widget,
|
|
78
|
+
H extends IHeading = IHeading
|
|
79
|
+
> {
|
|
77
80
|
/**
|
|
78
81
|
* Whether the factory can handle the widget or not.
|
|
79
82
|
*
|
|
@@ -92,7 +95,7 @@ export namespace TableOfContents {
|
|
|
92
95
|
createNew: (
|
|
93
96
|
widget: W,
|
|
94
97
|
configuration?: TableOfContents.IConfig
|
|
95
|
-
) => IModel<
|
|
98
|
+
) => IModel<H>;
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
/**
|