@covalent/components 8.15.0-beta.12 → 8.15.0-beta.13
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/notebook/notebook.d.ts +14 -1
- package/notebook/notebook.d.ts.map +1 -1
- package/notebook-cell/notebook-cell.d.ts.map +1 -1
- package/notebook-cell.js +8 -5
- package/notebook-cell.mjs +11 -8
- package/notebook.js +12 -18
- package/notebook.mjs +812 -753
- package/package.json +1 -1
package/notebook/notebook.d.ts
CHANGED
@@ -13,8 +13,10 @@ declare global {
|
|
13
13
|
}
|
14
14
|
}
|
15
15
|
interface CellData {
|
16
|
+
cell_type: string;
|
16
17
|
code: string;
|
17
18
|
errors?: string[];
|
19
|
+
execution_count?: number | null;
|
18
20
|
index?: number;
|
19
21
|
inputs?: {
|
20
22
|
password: boolean;
|
@@ -22,6 +24,10 @@ interface CellData {
|
|
22
24
|
}[];
|
23
25
|
language: string;
|
24
26
|
loading?: boolean;
|
27
|
+
metadata: {
|
28
|
+
tags?: string[];
|
29
|
+
trusted?: boolean;
|
30
|
+
};
|
25
31
|
outputs?: {
|
26
32
|
data: {
|
27
33
|
[key: string]: string;
|
@@ -33,6 +39,7 @@ interface CellData {
|
|
33
39
|
}[];
|
34
40
|
selected?: boolean;
|
35
41
|
showEditor?: boolean;
|
42
|
+
source: string;
|
36
43
|
timesExecuted?: number;
|
37
44
|
}
|
38
45
|
interface CellType {
|
@@ -61,15 +68,20 @@ export declare class CovalentNotebook extends LitElement {
|
|
61
68
|
private _draggedCellIndex;
|
62
69
|
private _selectedCellIndex;
|
63
70
|
static styles: import("lit").CSSResult[];
|
64
|
-
|
71
|
+
constructor();
|
72
|
+
addCell(cellType: string): void;
|
73
|
+
connectedCallback(): void;
|
65
74
|
copyCell(): void;
|
75
|
+
createNewCell(cellType: string): CellData;
|
66
76
|
cutCell(): void;
|
67
77
|
deleteCell(): void;
|
68
78
|
deselectAllCells(): void;
|
79
|
+
disconnectedCallback(): void;
|
69
80
|
dispatchCustomCellEvent(name: string, cell?: CellData): void;
|
70
81
|
dispatchUpdatedCells(): void;
|
71
82
|
protected firstUpdated(): void;
|
72
83
|
getDragImage(cellIndex: number): HTMLElement;
|
84
|
+
scrollToSelectedCell(selectedCellIndex: number): void;
|
73
85
|
handleCellTypeChange(e: CustomEvent): void;
|
74
86
|
handleCodeChange(e: CustomEvent, index: number): void;
|
75
87
|
handleDragStart(e: DragEvent, index: number): void;
|
@@ -78,6 +90,7 @@ export declare class CovalentNotebook extends LitElement {
|
|
78
90
|
handleDragLeave(e: DragEvent): void;
|
79
91
|
handleDragEnd(): void;
|
80
92
|
handleInputKeydown(event: KeyboardEvent): void;
|
93
|
+
private _handleKeydown;
|
81
94
|
handleOutputCLick(index: number): void;
|
82
95
|
pasteCell(): void;
|
83
96
|
renderCellOutput(cell: CellData): TemplateResult<1>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../../../libs/components/src/notebook/notebook.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,cAAc,EAEd,cAAc,EAEf,MAAM,KAAK,CAAC;AAIb,OAAO,gBAAgB,CAAC;AACxB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gCAAgC,CAAC;AACxC,OAAO,8BAA8B,CAAC;AACtC,OAAO,cAAc,CAAC;AACtB,OAAO,4BAA4B,CAAC;AACpC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,kBAAkB,CAAC;AAE1B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,gBAAgB,CAAC;KACjC;CACF;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CA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
{"version":3,"file":"notebook-cell.d.ts","sourceRoot":"","sources":["../../../../libs/components/src/notebook-cell/notebook-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;AAKvE,OAAO,4BAA4B,CAAC;AACpC,OAAO,8BAA8B,CAAC;AACtC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAElC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,oBAAoB,CAAC;KAC1C;CACF;AAMD,qBACa,oBAAqB,SAAQ,UAAU;IAClD;;OAEG;IAEH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,QAAQ,SAAM;IAEd;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,aAAa,SAAK;IAElB;;OAEG;IAEH,UAAU,CAAC,sBAAQ;IAEnB,cAAc,UAAS;IAEvB,aAAa;;;;;;;;;;;;;;;;;;MAgBX;IAEF,OAAgB,MAAM,4BAIpB;IAEF,gBAAgB,CAAC,CAAC,EAAE,WAAW;IAI/B,SAAS;IAUT,cAAc,CAAC,QAAQ,EAAE,OAAO;IAKhC,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAgBnD,YAAY;IA2BZ,oBAAoB;IAapB,SAAS,CAAC,MAAM;CAuBjB;AAED,eAAe,oBAAoB,CAAC"}
|
package/notebook-cell.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./query-assigned-elements-f623705d.js"),l=require("./property-57f6f6fe.js"),c=require("./class-map-0a4c6ca9.js");require("./code-editor-3a09cbf1.js");require("./code-snippet.js");require("./icon-button.js");require("./typography.js");require("./directive-1186bc23.js");require("./async-directive-4a34f75e.js");require("./directive-helpers-0ce1f995.js");require("./query-assigned-nodes-99eae71d.js");require("./_commonjsHelpers-2367a3a2.js");require("./tslib.es6-98719205.js");require("./ripple-handlers-9fb4a31a.js");require("./base-element-58a3f9ea.js");require("./utils-a8190a39.js");require("./state-0974a8e5.js");require("./query-680f1868.js");require("./style-map-a135c6ab.js");require("./aria-property-849c8816.js");require("./event-options-3f5eb195.js");require("./if-defined-f1c45245.js");const
|
2
|
-
`;var
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./query-assigned-elements-f623705d.js"),l=require("./property-57f6f6fe.js"),c=require("./class-map-0a4c6ca9.js");require("./code-editor-3a09cbf1.js");require("./code-snippet.js");require("./icon-button.js");require("./typography.js");require("./directive-1186bc23.js");require("./async-directive-4a34f75e.js");require("./directive-helpers-0ce1f995.js");require("./query-assigned-nodes-99eae71d.js");require("./_commonjsHelpers-2367a3a2.js");require("./tslib.es6-98719205.js");require("./ripple-handlers-9fb4a31a.js");require("./base-element-58a3f9ea.js");require("./utils-a8190a39.js");require("./state-0974a8e5.js");require("./query-680f1868.js");require("./style-map-a135c6ab.js");require("./aria-property-849c8816.js");require("./event-options-3f5eb195.js");require("./if-defined-f1c45245.js");const p=`:host{--mdc-icon-button-size: 24px;font-family:var(--mdc-typography-body1-font-family);width:100%}cv-code-snippet{background-color:var(--cv-theme-surface-container-high);border-radius:0;box-sizing:border-box;min-height:21px;padding:0 .25rem}cv-code-snippet::part(code){font-size:var(--mdc-typography-body2-font-size);line-height:var(--mdc-typography-body2-line-height);padding:1px 0;white-space:pre-wrap}cv-code-editor{margin-top:-1px}.selectionIndicator{background-color:var(--cv-theme-primary);border-radius:2px;cursor:move;height:100%;margin-top:2px;visibility:hidden}.selectionIndicatorWrapper{min-width:8px}.selectionIndicatorWrapper:hover .selectionIndicator{visibility:visible}.timesExecuted{color:var(--cv-theme-outline-variant);cursor:move;display:inline-flex;font-family:var(--mdc-typography-body2-font-family);font-size:var(--mdc-typography-body2-font-size);height:100%;justify-content:end;line-height:var(--mdc-typography-body2-line-height);width:50px;text-wrap:nowrap}.timesExecuted .executionCount{box-sizing:border-box;display:inline-block;max-width:32px;overflow:hidden;padding:0 2px;text-overflow:ellipsis;white-space:nowrap}.timesExecuted .loading{font-size:var(--mdc-typography-headline6-font-size);position:relative;top:.275rem}.cell{box-sizing:border-box;display:flex;justify-content:space-between}.cell.focused .selectionIndicator,.cell.selected .selectionIndicator{visibility:visible}.cell.focused .timesExecuted,.cell.selected .timesExecuted{color:var(--cv-theme-primary)}.cellWrapper{display:flex;flex-direction:column;width:100%}.cellCodeWrapper{align-items:start;display:flex;gap:.75rem;justify-content:end;width:calc(100% - 1.5rem)}.cellOutputWrapper{display:flex;flex-direction:column;gap:.75rem;width:calc(100% - 58px)}.output{max-width:100%}
|
2
|
+
`;var u=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(a,e,i,s)=>{for(var o=s>1?void 0:s?h(e,i):e,n=a.length-1,d;n>=0;n--)(d=a[n])&&(o=(s?d(e,i,o):d(o))||o);return s&&o&&u(e,i,o),o};exports.CovalentNotebookCell=class extends t.s{constructor(){super(...arguments),this.code="",this.language="",this.loading=!1,this.selected=!1,this.timesExecuted=0,this.showEditor=!0,this._editorFocused=!1,this.editorOptions={minimap:{enabled:!1},wordWrap:"on",fontSize:"14px",glyphMargin:!1,folding:!1,lineNumbers:"off",lineDecorationsWidth:0,lineNumbersMinChars:0,renderLineHighlight:"none",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,scrollbar:{alwaysConsumeMouseWheel:!1,vertical:"hidden"}}}handleCodeChange(e){this.code=e.detail.code}handleRun(){this.dispatchEvent(new CustomEvent("cell-run-code",{detail:{index:this.index,code:this.code},bubbles:!0,composed:!0}))}setEditorFocus(e){this._editorFocused=e,this.requestUpdate()}updated(e){var i,s;if(e.has("code")||e.has("language")){const o=(i=this.shadowRoot)==null?void 0:i.querySelector("cv-code-editor");if(o)o.code=this.code,o.language=this.language;else{const n=(s=this.shadowRoot)==null?void 0:s.querySelector("cv-code-snippet");n&&!this.selected&&n.highlight()}}super.updated(e)}renderEditor(){const e=this.selected?t.x`<cv-code-editor
|
3
3
|
@code-change="${this.handleCodeChange}"
|
4
4
|
@editor-focus="${()=>this.setEditorFocus(!0)}"
|
5
5
|
@editor-blur="${()=>this.setEditorFocus(!1)}"
|
@@ -14,7 +14,10 @@
|
|
14
14
|
<slot name="input"></slot>
|
15
15
|
</cv-typography>`;return t.x`${this.showEditor?e:""}${!this.showEditor&&this.language==="markdown"||this.language!=="markdown"?i:""}`}renderExecutionCount(){let e=t.x` `;return this.language==="markdown"?e:(this.loading?e=t.x`<span class="loading">*</span>`:e=t.x`${this.timesExecuted||" "}`,t.x`[<span class="executionCount">${e}</span>] :`)}render(){const e={cell:!0,selected:this.selected,focused:this._editorFocused};return t.x`
|
16
16
|
<div class="${c.o(e)}">
|
17
|
-
<
|
17
|
+
<div class="selectionIndicatorWrapper" draggable="true">
|
18
|
+
<div class="selectionIndicator"></div>
|
19
|
+
</div>
|
20
|
+
|
18
21
|
<div class="cellCodeWrapper">
|
19
22
|
<span class="timesExecuted" draggable="true"
|
20
23
|
>${this.renderExecutionCount()}</span
|
@@ -25,5 +28,5 @@
|
|
25
28
|
</div>
|
26
29
|
</div>
|
27
30
|
`}};exports.CovalentNotebookCell.styles=[t.i`
|
28
|
-
${t.r(
|
29
|
-
`];r([l.n({type:Number})],exports.CovalentNotebookCell.prototype,"index",2);r([l.n({type:String})],exports.CovalentNotebookCell.prototype,"code",2);r([l.n({type:String})],exports.CovalentNotebookCell.prototype,"language",2);r([l.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"loading",2);r([l.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"selected",2);r([l.n({type:Number})],exports.CovalentNotebookCell.prototype,"timesExecuted",2);r([l.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"showEditor",2);exports.CovalentNotebookCell=r([t.e("cv-notebook-cell")],exports.CovalentNotebookCell);const
|
31
|
+
${t.r(p)}
|
32
|
+
`];r([l.n({type:Number})],exports.CovalentNotebookCell.prototype,"index",2);r([l.n({type:String})],exports.CovalentNotebookCell.prototype,"code",2);r([l.n({type:String})],exports.CovalentNotebookCell.prototype,"language",2);r([l.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"loading",2);r([l.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"selected",2);r([l.n({type:Number})],exports.CovalentNotebookCell.prototype,"timesExecuted",2);r([l.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"showEditor",2);exports.CovalentNotebookCell=r([t.e("cv-notebook-cell")],exports.CovalentNotebookCell);const v=exports.CovalentNotebookCell;exports.default=v;
|
package/notebook-cell.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { i as p, r as
|
1
|
+
import { i as p, r as h, s as u, x as r, e as m } from "./query-assigned-elements-4a39219d.mjs";
|
2
2
|
import { n } from "./property-9b6ea53b.mjs";
|
3
3
|
import { o as g } from "./class-map-6e504a9a.mjs";
|
4
4
|
import "./code-editor-ce557bd5.mjs";
|
@@ -20,14 +20,14 @@ import "./style-map-e7ec6d41.mjs";
|
|
20
20
|
import "./aria-property-fa2717fe.mjs";
|
21
21
|
import "./event-options-78d6cf94.mjs";
|
22
22
|
import "./if-defined-c367f208.mjs";
|
23
|
-
const
|
23
|
+
const v = `:host{--mdc-icon-button-size: 24px;font-family:var(--mdc-typography-body1-font-family);width:100%}cv-code-snippet{background-color:var(--cv-theme-surface-container-high);border-radius:0;box-sizing:border-box;min-height:21px;padding:0 .25rem}cv-code-snippet::part(code){font-size:var(--mdc-typography-body2-font-size);line-height:var(--mdc-typography-body2-line-height);padding:1px 0;white-space:pre-wrap}cv-code-editor{margin-top:-1px}.selectionIndicator{background-color:var(--cv-theme-primary);border-radius:2px;cursor:move;height:100%;margin-top:2px;visibility:hidden}.selectionIndicatorWrapper{min-width:8px}.selectionIndicatorWrapper:hover .selectionIndicator{visibility:visible}.timesExecuted{color:var(--cv-theme-outline-variant);cursor:move;display:inline-flex;font-family:var(--mdc-typography-body2-font-family);font-size:var(--mdc-typography-body2-font-size);height:100%;justify-content:end;line-height:var(--mdc-typography-body2-line-height);width:50px;text-wrap:nowrap}.timesExecuted .executionCount{box-sizing:border-box;display:inline-block;max-width:32px;overflow:hidden;padding:0 2px;text-overflow:ellipsis;white-space:nowrap}.timesExecuted .loading{font-size:var(--mdc-typography-headline6-font-size);position:relative;top:.275rem}.cell{box-sizing:border-box;display:flex;justify-content:space-between}.cell.focused .selectionIndicator,.cell.selected .selectionIndicator{visibility:visible}.cell.focused .timesExecuted,.cell.selected .timesExecuted{color:var(--cv-theme-primary)}.cellWrapper{display:flex;flex-direction:column;width:100%}.cellCodeWrapper{align-items:start;display:flex;gap:.75rem;justify-content:end;width:calc(100% - 1.5rem)}.cellOutputWrapper{display:flex;flex-direction:column;gap:.75rem;width:calc(100% - 58px)}.output{max-width:100%}
|
24
24
|
`;
|
25
|
-
var
|
26
|
-
for (var o = s > 1 ? void 0 : s ?
|
25
|
+
var y = Object.defineProperty, f = Object.getOwnPropertyDescriptor, d = (e, i, a, s) => {
|
26
|
+
for (var o = s > 1 ? void 0 : s ? f(i, a) : i, l = e.length - 1, c; l >= 0; l--)
|
27
27
|
(c = e[l]) && (o = (s ? c(i, a, o) : c(o)) || o);
|
28
|
-
return s && o &&
|
28
|
+
return s && o && y(i, a, o), o;
|
29
29
|
};
|
30
|
-
let t = class extends
|
30
|
+
let t = class extends u {
|
31
31
|
constructor() {
|
32
32
|
super(...arguments), this.code = "", this.language = "", this.loading = !1, this.selected = !1, this.timesExecuted = 0, this.showEditor = !0, this._editorFocused = !1, this.editorOptions = {
|
33
33
|
minimap: { enabled: !1 },
|
@@ -106,7 +106,10 @@ let t = class extends h {
|
|
106
106
|
};
|
107
107
|
return r`
|
108
108
|
<div class="${g(e)}">
|
109
|
-
<
|
109
|
+
<div class="selectionIndicatorWrapper" draggable="true">
|
110
|
+
<div class="selectionIndicator"></div>
|
111
|
+
</div>
|
112
|
+
|
110
113
|
<div class="cellCodeWrapper">
|
111
114
|
<span class="timesExecuted" draggable="true"
|
112
115
|
>${this.renderExecutionCount()}</span
|
@@ -121,7 +124,7 @@ let t = class extends h {
|
|
121
124
|
};
|
122
125
|
t.styles = [
|
123
126
|
p`
|
124
|
-
${
|
127
|
+
${h(v)}
|
125
128
|
`
|
126
129
|
];
|
127
130
|
d([
|