@jupyterlab/cell-toolbar 4.0.0-alpha.6 → 4.0.0-beta.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/celltoolbartracker.d.ts +15 -29
- package/lib/celltoolbartracker.js +199 -109
- package/lib/celltoolbartracker.js.map +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/package.json +19 -20
- package/src/celltoolbartracker.ts +479 -0
- package/src/index.ts +9 -0
- package/style/base.css +14 -8
- package/lib/cellmenu.d.ts +0 -20
- package/lib/cellmenu.js +0 -68
- package/lib/cellmenu.js.map +0 -1
- package/lib/celltoolbarwidget.d.ts +0 -9
- package/lib/celltoolbarwidget.js +0 -14
- package/lib/celltoolbarwidget.js.map +0 -1
- package/lib/tokens.d.ts +0 -25
- package/lib/tokens.js +0 -2
- package/lib/tokens.js.map +0 -1
- package/lib/toolbarbutton.d.ts +0 -56
- package/lib/toolbarbutton.js +0 -54
- package/lib/toolbarbutton.js.map +0 -1
- package/lib/utils.d.ts +0 -7
- package/lib/utils.js +0 -16
- package/lib/utils.js.map +0 -1
- package/style/icons/addabove.svg +0 -11
- package/style/icons/addbelow.svg +0 -11
- package/style/icons/delete.svg +0 -4
- package/style/icons/duplicate.svg +0 -4
- package/style/icons/movedown.svg +0 -3
- package/style/icons/moveup.svg +0 -3
package/lib/toolbarbutton.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { ReactWidget } from '@jupyterlab/apputils';
|
|
2
|
-
import { LabIcon } from '@jupyterlab/ui-components';
|
|
3
|
-
/**
|
|
4
|
-
* Toggle button properties
|
|
5
|
-
*/
|
|
6
|
-
export interface IToggleButtonProps {
|
|
7
|
-
/**
|
|
8
|
-
* Button class name
|
|
9
|
-
*/
|
|
10
|
-
className?: (state: boolean) => string;
|
|
11
|
-
/**
|
|
12
|
-
* Button label
|
|
13
|
-
*/
|
|
14
|
-
label?: (state: boolean) => string;
|
|
15
|
-
/**
|
|
16
|
-
* Button icon
|
|
17
|
-
*/
|
|
18
|
-
icon?: (state: boolean) => LabIcon;
|
|
19
|
-
/**
|
|
20
|
-
* Button tooltip
|
|
21
|
-
*/
|
|
22
|
-
tooltip?: (state: boolean) => string;
|
|
23
|
-
/**
|
|
24
|
-
* Button callback
|
|
25
|
-
*/
|
|
26
|
-
onClick?: (state: boolean) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Button enabled status
|
|
29
|
-
*/
|
|
30
|
-
enabled?: (state: boolean) => boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Trigger the button on the actual onClick event rather than onMouseDown.
|
|
33
|
-
*
|
|
34
|
-
* See note in ToolbarButtonComponent below as to why the default is to
|
|
35
|
-
* trigger on onMouseDown.
|
|
36
|
-
*/
|
|
37
|
-
actualOnClick?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export declare class ToggleButton extends ReactWidget {
|
|
40
|
-
protected props: IToggleButtonProps;
|
|
41
|
-
/**
|
|
42
|
-
* Creates a toolbar toggle button
|
|
43
|
-
*
|
|
44
|
-
* Initial state is false
|
|
45
|
-
*
|
|
46
|
-
* @param props props for underlying `ToolbarButton` component
|
|
47
|
-
*/
|
|
48
|
-
constructor(props?: IToggleButtonProps);
|
|
49
|
-
/**
|
|
50
|
-
* Toggled button state
|
|
51
|
-
*/
|
|
52
|
-
get toggled(): boolean;
|
|
53
|
-
set toggled(value: boolean);
|
|
54
|
-
render(): JSX.Element;
|
|
55
|
-
protected _toggled: boolean;
|
|
56
|
-
}
|
package/lib/toolbarbutton.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/* -----------------------------------------------------------------------------
|
|
2
|
-
| Copyright (c) Jupyter Development Team.
|
|
3
|
-
| Distributed under the terms of the Modified BSD License.
|
|
4
|
-
|----------------------------------------------------------------------------*/
|
|
5
|
-
import { addToolbarButtonClass, ReactWidget, ToolbarButtonComponent } from '@jupyterlab/apputils';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
export class ToggleButton extends ReactWidget {
|
|
8
|
-
/**
|
|
9
|
-
* Creates a toolbar toggle button
|
|
10
|
-
*
|
|
11
|
-
* Initial state is false
|
|
12
|
-
*
|
|
13
|
-
* @param props props for underlying `ToolbarButton` component
|
|
14
|
-
*/
|
|
15
|
-
constructor(props = {}) {
|
|
16
|
-
super();
|
|
17
|
-
this.props = props;
|
|
18
|
-
this._toggled = false;
|
|
19
|
-
addToolbarButtonClass(this);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Toggled button state
|
|
23
|
-
*/
|
|
24
|
-
get toggled() {
|
|
25
|
-
return this._toggled;
|
|
26
|
-
}
|
|
27
|
-
set toggled(value) {
|
|
28
|
-
if (value !== this._toggled) {
|
|
29
|
-
this._toggled = value;
|
|
30
|
-
this.update();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
render() {
|
|
34
|
-
const p = {
|
|
35
|
-
className: this.props.className
|
|
36
|
-
? this.props.className(this.toggled)
|
|
37
|
-
: undefined,
|
|
38
|
-
label: this.props.label ? this.props.label(this.toggled) : undefined,
|
|
39
|
-
icon: this.props.icon ? this.props.icon(this.toggled) : undefined,
|
|
40
|
-
tooltip: this.props.tooltip
|
|
41
|
-
? this.props.tooltip(this.toggled)
|
|
42
|
-
: undefined,
|
|
43
|
-
onClick: this.props.onClick
|
|
44
|
-
? () => {
|
|
45
|
-
this.toggled = !this.toggled;
|
|
46
|
-
this.props.onClick(this.toggled);
|
|
47
|
-
}
|
|
48
|
-
: undefined,
|
|
49
|
-
enabled: this.props.enabled ? this.props.enabled(this.toggled) : undefined
|
|
50
|
-
};
|
|
51
|
-
return React.createElement(ToolbarButtonComponent, Object.assign({}, p));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=toolbarbutton.js.map
|
package/lib/toolbarbutton.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toolb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,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;gBAClC,CAAC,CAAC,SAAS;YACb,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;gBACzB,CAAC,CAAC,GAAS,EAAE;oBACT,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;oBAC5B,IAAI,CAAC,KAAK,CAAC,OAAgC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC7D,CAAC;gBACH,CAAC,CAAC,SAAS;YACb,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;SAC3E,CAAC;QACF,OAAO,oBAAC,sBAAsB,oBAAK,CAAC,EAAI,CAAC;IAC3C,CAAC;CAGF"}
|
package/lib/utils.d.ts
DELETED
package/lib/utils.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* -----------------------------------------------------------------------------
|
|
2
|
-
| Copyright (c) Jupyter Development Team.
|
|
3
|
-
| Distributed under the terms of the Modified BSD License.
|
|
4
|
-
|----------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* Get the value of a CSS variable
|
|
7
|
-
*
|
|
8
|
-
* @param name CSS variable name
|
|
9
|
-
* @returns The CSS variable value
|
|
10
|
-
*/
|
|
11
|
-
export function getCSSVar(name) {
|
|
12
|
-
return getComputedStyle(document.documentElement)
|
|
13
|
-
.getPropertyValue(name)
|
|
14
|
-
.trim();
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;+EAG+E;AAC/E;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC;SAC9C,gBAAgB,CAAC,IAAI,CAAC;SACtB,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
package/style/icons/addabove.svg
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g clip-path="url(#clip0_137_19492)">
|
|
3
|
-
<path class="jp-icon3" d="M4.75 4.93066H6.625V6.80566C6.625 7.01191 6.79375 7.18066 7 7.18066C7.20625 7.18066 7.375 7.01191 7.375 6.80566V4.93066H9.25C9.45625 4.93066 9.625 4.76191 9.625 4.55566C9.625 4.34941 9.45625 4.18066 9.25 4.18066H7.375V2.30566C7.375 2.09941 7.20625 1.93066 7 1.93066C6.79375 1.93066 6.625 2.09941 6.625 2.30566V4.18066H4.75C4.54375 4.18066 4.375 4.34941 4.375 4.55566C4.375 4.76191 4.54375 4.93066 4.75 4.93066Z" fill="#616161" stroke="#616161" stroke-width="0.7"/>
|
|
4
|
-
</g>
|
|
5
|
-
<path class="jp-icon3" fill-rule="evenodd" clip-rule="evenodd" d="M11.5 9.5V11.5L2.5 11.5V9.5L11.5 9.5ZM12 8C12.5523 8 13 8.44772 13 9V12C13 12.5523 12.5523 13 12 13L2 13C1.44772 13 1 12.5523 1 12V9C1 8.44772 1.44771 8 2 8L12 8Z" fill="#616161"/>
|
|
6
|
-
<defs>
|
|
7
|
-
<clipPath id="clip0_137_19492">
|
|
8
|
-
<rect class="jp-icon3" width="6" height="6" fill="white" transform="matrix(-1 0 0 1 10 1.55566)"/>
|
|
9
|
-
</clipPath>
|
|
10
|
-
</defs>
|
|
11
|
-
</svg>
|
package/style/icons/addbelow.svg
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g clip-path="url(#clip0_137_19498)">
|
|
3
|
-
<path class="jp-icon3" d="M9.25 10.0693L7.375 10.0693L7.375 8.19434C7.375 7.98809 7.20625 7.81934 7 7.81934C6.79375 7.81934 6.625 7.98809 6.625 8.19434L6.625 10.0693L4.75 10.0693C4.54375 10.0693 4.375 10.2381 4.375 10.4443C4.375 10.6506 4.54375 10.8193 4.75 10.8193L6.625 10.8193L6.625 12.6943C6.625 12.9006 6.79375 13.0693 7 13.0693C7.20625 13.0693 7.375 12.9006 7.375 12.6943L7.375 10.8193L9.25 10.8193C9.45625 10.8193 9.625 10.6506 9.625 10.4443C9.625 10.2381 9.45625 10.0693 9.25 10.0693Z" fill="#616161" stroke="#616161" stroke-width="0.7"/>
|
|
4
|
-
</g>
|
|
5
|
-
<path class="jp-icon3" fill-rule="evenodd" clip-rule="evenodd" d="M2.5 5.5L2.5 3.5L11.5 3.5L11.5 5.5L2.5 5.5ZM2 7C1.44772 7 1 6.55228 1 6L1 3C1 2.44772 1.44772 2 2 2L12 2C12.5523 2 13 2.44772 13 3L13 6C13 6.55229 12.5523 7 12 7L2 7Z" fill="#616161"/>
|
|
6
|
-
<defs>
|
|
7
|
-
<clipPath id="clip0_137_19498">
|
|
8
|
-
<rect class="jp-icon3" width="6" height="6" fill="white" transform="matrix(1 1.74846e-07 1.74846e-07 -1 4 13.4443)"/>
|
|
9
|
-
</clipPath>
|
|
10
|
-
</defs>
|
|
11
|
-
</svg>
|
package/style/icons/delete.svg
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path class="jp-icon3" fill-rule="evenodd" clip-rule="evenodd" d="M2.79998 0.875H8.89582C9.20061 0.875 9.44998 1.13914 9.44998 1.46198C9.44998 1.78482 9.20061 2.04896 8.89582 2.04896H3.35415C3.04936 2.04896 2.79998 2.3131 2.79998 2.63594V9.67969C2.79998 10.0025 2.55061 10.2667 2.24582 10.2667C1.94103 10.2667 1.69165 10.0025 1.69165 9.67969V2.04896C1.69165 1.40328 2.1904 0.875 2.79998 0.875ZM5.36665 11.9V4.55H11.0833V11.9H5.36665ZM4.14165 4.14167C4.14165 3.69063 4.50728 3.325 4.95832 3.325H11.4917C11.9427 3.325 12.3083 3.69063 12.3083 4.14167V12.3083C12.3083 12.7594 11.9427 13.125 11.4917 13.125H4.95832C4.50728 13.125 4.14165 12.7594 4.14165 12.3083V4.14167Z" fill="#616161"/>
|
|
3
|
-
<path class="jp-icon3" d="M9.43574 8.26507H8.36431V9.3365C8.36431 9.45435 8.26788 9.55078 8.15002 9.55078C8.03217 9.55078 7.93574 9.45435 7.93574 9.3365V8.26507H6.86431C6.74645 8.26507 6.65002 8.16864 6.65002 8.05078C6.65002 7.93292 6.74645 7.8365 6.86431 7.8365H7.93574V6.76507C7.93574 6.64721 8.03217 6.55078 8.15002 6.55078C8.26788 6.55078 8.36431 6.64721 8.36431 6.76507V7.8365H9.43574C9.5536 7.8365 9.65002 7.93292 9.65002 8.05078C9.65002 8.16864 9.5536 8.26507 9.43574 8.26507Z" fill="#616161" stroke="#616161" stroke-width="0.5"/>
|
|
4
|
-
</svg>
|
package/style/icons/movedown.svg
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path class="jp-icon3" d="M12.471 7.52899C12.7632 7.23684 12.7632 6.76316 12.471 6.47101V6.47101C12.179 6.17905 11.7057 6.17884 11.4135 6.47054L7.75 10.1275V1.75C7.75 1.33579 7.41421 1 7 1V1C6.58579 1 6.25 1.33579 6.25 1.75V10.1275L2.59726 6.46822C2.30338 6.17381 1.82641 6.17359 1.53226 6.46774V6.46774C1.2383 6.7617 1.2383 7.2383 1.53226 7.53226L6.29289 12.2929C6.68342 12.6834 7.31658 12.6834 7.70711 12.2929L12.471 7.52899Z" fill="#616161"/>
|
|
3
|
-
</svg>
|
package/style/icons/moveup.svg
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path class="jp-icon3" d="M1.52899 6.47101C1.23684 6.76316 1.23684 7.23684 1.52899 7.52899V7.52899C1.82095 7.82095 2.29426 7.82116 2.58649 7.52946L6.25 3.8725V12.25C6.25 12.6642 6.58579 13 7 13V13C7.41421 13 7.75 12.6642 7.75 12.25V3.8725L11.4027 7.53178C11.6966 7.82619 12.1736 7.82641 12.4677 7.53226V7.53226C12.7617 7.2383 12.7617 6.7617 12.4677 6.46774L7.70711 1.70711C7.31658 1.31658 6.68342 1.31658 6.29289 1.70711L1.52899 6.47101Z" fill="#616161"/>
|
|
3
|
-
</svg>
|